<datepicker>

A simple date picker

JavaScript: datepicker

Extends Basedatepicker

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

 
<canvas height="200"> 
     <datepicker showingdate="new Date(2006,3,1)"
                 earliestdate="new Date( 2003, 9, 5)" 
                 latestdate="new Date( 2005, 1, 5)"
                 selecteddate="new Date( 2006, 3, 20)">
        <handler name="onselecteddate">
            if( this.selecteddate != null ) {
                display.year.setText( this.selecteddate.getFullYear() );
                display.month.datapath.setXPath(
                        "datepicker_strings_en:/months/month[@index='" + 
                        this.selecteddate.getMonth() + "']/@full" ); 
                display.date.setText( 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 Usage Type (Tag) Type (JS) Default Category
allowdrag Tag & JS boolean Boolean true setter

startAsIcon Tag & JS boolean Boolean   setter
 

Set to true to initially show the datepicker as an icon, otherwise set to false.



Attributes inherited from Basecomponent

doesenter, enabled, hasdefault, isdefault, style, styleable, text

Attributes inherited from Basedatepicker

dayclass, earliestdate, latestdate, selecteddate, selecteddatepickerday, showingdate, showingmonth, showingyear, weekclass, xinset, yinset

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset


Methods

doEnterUp()
datepicker.doEnterUp()


doSpaceUp()
datepicker.doSpaceUp()


expandFromIcon()
datepicker.expandFromIcon()


handleSelected()
datepicker.handleSelected()


init()
datepicker.init()


setMonthToShow()
datepicker.setMonthToShow(month, year)

Set the month to show in the basedatepicker.

Parameters
Name Type Desc
month The month of the year to show
year The year of the month to show


shrinkToIcon()
datepicker.shrinkToIcon()


Methods inherited from basecomponent

doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, setStyle, setTint, updateDefault

Methods inherited from basedatepicker

focusOnDay, focusOnFirstDayInMonth, focusOnLastDayInMonth, getNumberOfDaysInMonth, handleKeyDown, handleKeyUp, init, isDayDisabled, isLastWeekInMonth, removeFocusFromDay, selectFocusDay, setMonthToShow, setSelecteddatepickerday, setStartingDay, showNextMonth, showPreviousMonth

Methods inherited from LzNode

animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize


Events

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony