Using the DatePicker Control

The WinJS DatePicker control—and, I hope you don’t find this shocking—enables you to pick a date. It displays three select lists: month, day, and year (see Figure 4.13).

Image

FIGURE 4.13 Displaying a DatePicker control

You declare a DatePicker like this:

<div id="dateBirthday"     data-win-control="WinJS.UI.DatePicker"></div>

Warning

Don’t forget to call WinJS.UI.processAll() or your DatePicker will never become a DatePicker.

By default, the DatePicker control has today’s date selected. You can assign a particular date to the DatePicker control by setting the control’s current property ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.