It is easier for users to input dates via a date picker where they are presented with scroll wheels. This has become a standard user interface object and is expected by users. This recipe shows you how to use a date picker in LiveCode.
To use a date picker, follow the given steps:
Create a new main stack.
Drag a button to the stack's card and assign the following properties:
Name:
Launch Date Picker
Width:
184
Height:
23
Location:
200
,33
Add the following code to the new button to initiate a date picker, as displayed in the given screenshot:
on mouseUp mobilePickDate "date" end mouseUp
The output will be as follows:
When the user selects the date (month, day, year) and taps Done, you will want to ensure that you have a way to capture the date. LiveCode puts the user's selection into the
the result
system variable. You can test this by adding one line of code to themobilePickDate
command:on mouseUp mobilePickDate "date" answer the result end mouseUp...