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

format()

Obtain the display String of widgets.

str

getDateTimeString( formatString )

Obtain the displayed time of widgets.

int

getDay()

Obtain the day of widgets.

int

getHour()

Obtain the hour of widgets.

int

getMinute()

Obtain the minute of widgets.

int

getMonth()

Obtain the month of widgets.

int

getYear()

Obtain the year of widgets.

int

getSecond()

Obtain the second of widgets.


setCurrentDateTime()

Set the time of widgets as the current time.


setDateTime( text )

Set the time of widgets.


setDateTime( year, month, day, hour, minute, second )

Set the time of widgets.


setDay( day )

Set the day of widgets.


setFormat( text )

Set the date/time format of widgets.


setHour( hour )

Set the hour of widgets.


setMinute( minute )

Set the minute of widgets.


setMonth( month )

Set the month of widgets.


setSecond( second )

Set the second of widgets.


setYear( year )

Set the year of widgets.




  setDateTime( text:Time String )

 

  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');

   




                                         



  setDateTime( year:Year, month:Month, day:Day, hour:Hour, minute:Minute, second:Second )

 

  setDateTime sets the time of widgets.


        ㆍ When entering year, month, day, hour, minute, second on parameters, the date is entered to the widget and displayed.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain dateTimeWidget object.

       obj.setDateTime(2000, 12, 25, 18, 55, 44);

   




                                         



  setCurrentDateTime()

 

  setCurrentDateTime sets the time of widgets as the current time.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain dateTImeWidget object.

       obj.setCurrentDateTime();


   



                                         



  str getDateTimeString( text:Date format )

 

  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( year:Year )

 

  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( month:Month )

 

  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( day:Day )

 

  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( hour:Hour )

 

  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( minute:Minute )

 

  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( second:Second )

 

  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.


   



                                         



  int getYear()

 

  getYear obtains the year of widgets.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object.

       val = obj.getYear(); << Obtain the year.

       app.messageBox(val);


   



                                         



  int getMonth()

 

  getMonth obtains the month of widgets.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object.

       val = obj.getMonth(); << Obtain the month.

       app.messageBox(val);


   



                                         



  int getDay()

 

  getDay obtains the day of widgets.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object.

       val = obj.getDay(); << Obtain the day.

       app.messageBox(val);





                                         



  int getHour()

 

  , getHour obtains the hour of widgets.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object.

       val = obj.getHour(); << Obtain the hour.

       app.messageBox(val);





                                         



  int getMinute()

 

  getMinute obtains the minute of widgets.



  Example)

   


       obj = canvas.getObject('DateTime'); << Obtain the dateTimeWidget object.

       val = obj.getMinute(); << Obtain the minute.

       app.messageBox(val);





                                         



  int getSecond()

 

  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( text:String format )

 

  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');





                                         



  str format()

 

  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);