Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Created February 1, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/1717901 to your computer and use it in GitHub Desktop.
Save brianjmiller/1717901 to your computer and use it in GitHub Desktop.
Selects with date
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