Date Widget
Date Widget
Date widget is used to select dates. The usage is similar to the date/time widget, it provides a more comfortable and improved UI than date/time widget.
Methods
Return Type |
Method |
Description |
str |
Read the currently set date format. |
|
str |
Read the date displayed on the widget as a String with the default format. |
|
str |
Read the date displayed on the widget as a String with the entered format. |
|
int |
Obtain the day of widgets. |
|
int |
Obtain the month of widgets. |
|
int |
Obtain the year of widgets. |
|
Display the current date on the widget. |
||
Display the date on the widget. |
||
Display the entered date on the widget. |
||
Set the day of widgets. |
||
Set the date format of widgets. |
||
Set the month of widgets. |
||
Set the year of widgets. |
||
Set the date select mode of widgets. |
Set the date to the widget. ㆍ Enter the time String to text. Example) ‘2013-01-01’ Example)
obj = canvas.getObject('DateTime'); << Obtain the obejct. obj.setDate('2013-01-01');
|
Set the date to the widget. ㆍ The date is set according to the parameters(Year, Month, Day). Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setDate(2000, 12, 25);
|
Display the current date on the widget. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setCurrentDate();
|
Obtain the date displayed on widgets as a String with the entered format. ㆍ If the text is empty, it obtains the date as a default format. ㆍ The default format is ''yyyy-MM-dd'. ㆍ If the text is not empty, it obtains the date as the entered format. Example) If the date is 2013-01-01 when entering 'MM-dd', 01-01 is returned. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getDateString(); << Read the date as a String with the default format. app.messageBox(val); val = obj.getDateString('yyyy-MM-dd HH'); << Obtain the currently displaying date as a String with yyyy-MM-dd HH format. app.messageBox(val);
|
setYear changes the year of widgets to year. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setYear(2012); << Change the year to 2012.
|
setMonth changes the month of widgets to month. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setMonth(11); << Change the month to 11.
|
setDay changes the day of widgets to day. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setDay(22); << Change the day to 22.
|
getYear obtains the year of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dataTimeWidget objects. val = obj.getYear(); << Obtain the year. app.messageBox(val);
|
getMonth obtains the month of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getMonth(); << Obtain the month. app.messageBox(val);
|
getDay obtains the day of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getDay(); << Obtain the day. app.messageBox(val); |
|
Set the date format. ㆍ The date format is changed based on text. ㆍ The default format is 'yyyy-MM-dd'. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setFormat('yy.MM.dd'); |
Obtain the current date format. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.format(); << Obtain the default format.
|
Set the date select mode of widgets. ㆍ There are three kinds of types. - 0 : Day - 1 : Month - 2 : Year Example) If the date select mode is set as day.
obj = canvas.getObject('DateTime'); << Obtain the object. obj.setDateSelectMode(0);
Example) If the date select mode is set as month.
obj = canvas.getObject('DateTime'); << Obtain the object. obj.setDateSelectMode(1);
Example) If the date select mode is set as year.
obj = canvas.getObject('DateTime'); << Obtain the object. obj.setDateSelectMode(2);
|