<datepicker>
A simple date picker

JavaScript: lz.datepicker

Datepicker is a simple component that makes it easy for users to select dates.

<canvas height="200"> 
              <datepicker showingdate="new Date()" earliestdate="new Date( 2007, 1, 1)" latestdate="new Date( 2008, 11, 31)" selecteddate="new Date()">
              <handler name="onselecteddate">
              if( this.selecteddate != null ) {
              display.year.setAttribute('text', this.selecteddate.getFullYear() );
              display.month.datapath.setXPath(
              "datepicker_strings_en:/months/month[@index='" + 
              this.selecteddate.getMonth() + "']/@full" ); 
              display.date.setAttribute('text', this.selecteddate.getDate() );
              } 
              </handler>
              </datepicker> 

              <view id="display">
              <text name="month" resize="true" datapath="."/>
              <text name="date" resize="true"/>
              <text name="year" resize="true"/> 
              <simplelayout axis="x" spacing="2"/>
              </view>
              <simplelayout axis="y" spacing="10"/>
              </canvas>

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
allowdrag boolean boolean true read/write
   
startAsIcon boolean boolean true read/write
  Set to true to initially show the datepicker as an icon, otherwise set to false.

Methods

setMonthToShow()
datepicker.setMonthToShow(month, year);
Set the month to show in the basedatepicker.
Parameter Name Type Description
month   The month of the year to show
year   The year of the month to show

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy