Date/Time Widget
Date/Time Widget
Date/Time widget is used to set date and time. It consists of year, month, day, hour, minute, second. It can set or obtain the entire, and it can change or obtain individual visual.
Methods
Return Type |
Method |
Description |
str |
Obtain the display String of widgets. |
|
str |
Obtain the displayed time of widgets. |
|
int |
Obtain the day of widgets. |
|
int |
Obtain the hour of widgets. |
|
int |
Obtain the minute of widgets. |
|
int |
Obtain the month of widgets. |
|
int |
Obtain the year of widgets. |
|
int |
Obtain the second of widgets. |
|
Set the time of widgets as the current time. |
||
Set the time of widgets. |
||
Set the time of widgets. |
||
Set the day of widgets. |
||
Set the date/time format of widgets. |
||
Set the hour of widgets. |
||
Set the minute of widgets. |
||
Set the month of widgets. |
||
Set the second of widgets. |
||
Set the year of widgets. |
setDateTime sets the time of widgets. ㆍ Enter the time String to text. Example) ‘2013-01-01 11:11:11’ Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setDateTime('2013-01-01 11:11:11');
|
|
setCurrentDateTime sets the time of widgets as the current time. Example)
obj = canvas.getObject('DateTime'); << Obtain dateTImeWidget object. obj.setCurrentDateTime();
|
|
getDateTimeString obtains the currently displaying time as a String format. ㆍ If text is empty, it obtains the date as the default format. ㆍ The default format 'yyyy-MM-dd HH:mm:ss' ㆍ If text is not empty, it obtains the date as that format. Example) If the date is 2013-01-01 01:00:00, when entering 'MM-dd HH:mm', 01-01 01:00 is returned. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getDateTimeString(); << Obtain the currently displaying time as a String with the default format. app.messageBox(val); val = obj.getDateTimeString('yyyy-MM-dd HH'); << Obtain the currently displaying time 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
|
|
setHour changes the hour of widgets to hour. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setHour(5); << Change the hour to 5.
|
|
setMinute changes the minute of widgets to minute. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setMinute(15); << Change the minute to 15.
|
|
setSecond changes the second of widgets to second. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. obj.setSecond(25); << Change the second to 25.
|
|
getYear obtains the year of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. 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); |
|
, getHour obtains the hour of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getHour(); << Obtain the hour. app.messageBox(val); |
|
getMinute obtains the minute of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getMinute(); << Obtain the minute. app.messageBox(val); |
|
getSecond obtains the second of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.getSecond(); << Obtain the second. app.messageBox(val); |
|
setFormat sets the format of String. ㆍ The date format is changed based on text. ㆍ The default format is 'yyyy-MM-dd H:mm:ss'. Example)
obj = canvas.getObject('DateTime'); << Obtain dateTimeWidget object. obj.setFormat('yy.MM.dd HH-mm-ss'); |
|
format obtains the format of widgets. Example)
obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object. val = obj.format(); << Obtain the default format. app.messageBox(val); obj.setFormat(‘yy.MM.dd HH-mm-ss’); val = obj.format(); << Obtain the new format. app.messageBox(val); |
|