I'm using dateinput() from the jQuery TOOLS UI library, and I set min and max dates.
However, I want to get those values after setting them. How can achieve this?
I'm using dateinput() from the jQuery TOOLS UI library, and I set min and max dates.
However, I want to get those values after setting them. How can achieve this?
You can try this:
$(":date").dateinput({
format: 'dddd dd, mmmm yyyy', // the format displayed for the user
selectors: true, // whether month/year dropdowns are shown
min: -100, // min selectable day (100 days backwards)
max: 100, // max selectable day (100 days onwards)
offset: [10, 20], // tweak the position of the calendar
speed: 'fast', // calendar reveal speed
firstDay: 1, // which day starts a week. 0 = sunday, 1 = monday etc..
change: function (a) {
console.log($(this)[0].getConf().min);//min value
console.log($(this)[0].getConf().max);//max value
}
});
HTML:
<input type="date" name="date1" value="Today" />
<input type="date" name="date2" value="10 days from now" min="2010-03-01" max="2012-01-01" class="one" />
<input type="date" name="date3" value="15" min="-25" max="25" data-value="15" />
Demo: http://jsfiddle.net/GCu2D/159/
Apart from change function, it also has onShow and onHide just in case if you want to use min max later or on show.
dateinputis not a standard plugin. Can you please give more details on exactly what you're using. - Rory McCrossan