Back

showDateTimePicker

JS Py
Hello World
Content:
- Methods

Show a DateTimePicker where the user can select a date and time.

dtp = ui.showDateTimePicker( callback, date, time, format ) → Object: DateTimePicker Component

If you want a date picker only see DatePicker or if you want time picker only see TimePicker

Example - DateTimePicker

class Main extends App
{
    onStart()
    {
        this.main = ui.addLayout( "main", "Linear", "VCenter", 1, 1 )

        this.btn = ui.addButton( this.main, "Show Date Time Picker", "Primary" )
        this.btn.setOnTouch( this.btn_onTouch )
    }

    btn_onTouch()
    {
        ui.showDateTimePicker( this.onDateTime )
    }

    onDateTime( val )
    {
        ui.showPopup( val )
    }
}
from hybrid import ui

def OnStart():
    main = ui.addLayout("main", "Linear", "VCenter", 1, 1)

    btn = ui.addButton(main, "Show Date Time Picker", "Primary")
    btn.setOnTouch(btn_onTouch)

def btn_onTouch(event):
    ui.showDateTimePicker(onDateTime)

def onDateTime(val):
    ui.showPopup(val)
Copy All       Run      

Methods

The following methods are available on the showDateTimePicker object:

String: “Default value for date of the form "MM/DD/YYYY"”
String: “Default value for time of the form "HH/MM/SS"”
String: “The format value that will be pass to callback. Formats can be of the form
`MM/DD/YYYY HH:SS` `MM:YYYY HH:SS`”
function()
function( value )
dtp.setOnSelect
Sets a callback function on select date and time