The DojoCalendar widget creates a calendar and displays a value of type Date.


The user can change the year by clicking the left or right year at the bottom of the calendar.
You can get or set the date. The default is the current date.
function isSelectorOpen() returns (boolean);
Other supported properties and functions are described in “Widget properties and functions” and “Widget styles.”
package myPkg;
import com.ibm.egl.rui.widgets.GridLayout;
import com.ibm.egl.rui.widgets.GridLayoutData;
import dojo.widgets.DojoCalendar;
import dojo.widgets.DojoButton;
import egl.javascript.Job;
handler MyHandler type RUIhandler {
initialUI = [ ui ], onConstructionFunction = start,
cssFile="css/MyRichUIProject.css", title="MyHandler"}
ui GridLayout{ columns = 3, rows = 4, cellPadding = 4,
children = [ myButton, myCalendar ] };
myCalendar DojoCalendar{ layoutData = new GridLayoutData{ row = 2, column = 2 },
value = DateTimeLib.currentDate() };
myButton DojoButton{ layoutData = new GridLayoutData{ row = 4, column = 2 },
text = "Is the month selector open?",
onClick ::= myEventHandler};
doThis Job{runFunction = myRunFunction};
function start()
strLib.defaultDateFormat = "yyyy/MM/dd";
end
function myEventHandler( e event in)
doThis.repeat(1000);
myCalendar.value = "2012/04/08";
end
function myRunFunction()
isListBoxOpen Boolean = myCalendar.isSelectorOpen();
writestdout ("The selector is open: " + isListBoxOpen);
if (isListBoxOpen)
doThis.cancel();
end
writestdout ("The date is " + myCalendar.value);
end
end