(function($, undefined){ "use strict"; $.widget("ui.dateSliderDemo", $.ui.sliderDemo, { options: {}, _title: "Date values", _name: "dateRangeSlider", _createInputs: function(){ $.ui.sliderDemo.prototype._createInputs.apply(this, []); this._addPicker(this._elements.minInput); this._addPicker(this._elements.maxInput); (function(that){ that._elements.minInput.change(function(){ that._valueChanged($(this).datepicker("getDate"), "min"); }); that._elements.maxInput.change(function(){ that._valueChanged($(this).datepicker("getDate"), "max"); }); })(this); this._elements.minInput.change($.proxy(this._minChanged, this)); }, _createBoundsOptions: function(){ this._createDT("Bounds"); var minSelect = this._createSelect("min", "Bound"), maxSelect = this._createSelect("max", "Bound"); this._addDateOption(minSelect, new Date(2010, 0, 1)); this._addDateOption(minSelect, new Date(2010, 2, 1)); this._addDateOption(minSelect, new Date(2010, 5, 1)); this._addDateOption(maxSelect, new Date(2011, 11, 31, 11, 59, 59)); this._addDateOption(maxSelect, new Date(2011, 8, 31, 11, 59, 59)); this._addDateOption(maxSelect, new Date(2011, 5, 30, 11, 59, 59)); minSelect.bind("change", "min", $.proxy(this._changeBound, this)); maxSelect.bind("change", "max", $.proxy(this._changeBound, this)); }, _addDateOption: function(select, date){ this._addOption(select, this._format(date), date.valueOf()); }, _changeBound: function(event){ var value = $(event.target).val(), bounds = this._getOption("bounds"); bounds[event.data] = new Date(parseFloat(value)); this._setOption("bounds", bounds); }, _createStepOption: function(){ this._createDT("Step"); var select = $("