DatePicker.current property

Applies to Windows only

Gets or sets the current date of the DatePicker. You can use either a date string or a Date object to set this property.

Syntax


<div data-win-control="WinJS.UI.DatePicker" data-win-options="{ current : value}" ></div>


var current = datePicker.current;
datePicker.current = current;

Property value

Type: Date

The current date.

Examples

The following code shows how to get and set the current property.


<div id="dateDiv" data-win-control="WinJS.UI.DatePicker"></div>
<script type="text/javascript">
    WinJS.UI.processAll();

    var dp = document.getElementById("dateDiv").winControl;

    dp.current = "6/30/1999";
    var year = dp.current.getYear();

    // year is 99.

    dp.current = new Date("7/12/1970");
    year = dp.current.getYear();

    // year is 70.
    </script>

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

WinJS.UI

Library

Ui.js

See also

DatePicker

 

 

Show:
© 2014 Microsoft