Created
February 1, 2012 16:35
-
-
Save brianjmiller/1717901 to your computer and use it in GitHub Desktop.
Selects with date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selected_date = e.newSelection[0]; | |
var selected_month = selected_date.getMonth(); | |
this._calendarNavGoToDateMonthSelectNode.set("selectedIndex", selected_month); | |
var selected_day = selected_date.getDate(); | |
this._calendarNavGoToDateDaySelectNode.set("selectedIndex", selected_day - 1); | |
var selected_year = String(selected_date.getFullYear()); | |
this._calendarNavGoToDateYearSelectNode.all("option").each( | |
function (node, i, nl) { | |
if (node.get("value") === selected_year) { | |
this.set("selectedIndex", i); | |
} | |
}, | |
this._calendarNavGoToDateYearSelectNode | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment