kelvinluck jQuery datePicker: 2 inline calendars - i need to set EndDate of 2nd on selecting 1st cal
Posted
by lance
on Stack Overflow
See other posts from Stack Overflow
or by lance
Published on 2010-06-15T14:36:30Z
Indexed on
2010/06/15
14:42 UTC
Read the original article
Hit count: 169
Hi all
I'm stuck. Tried all the angles but i cant seem to get it working. I have 2 inline calendars. When i select a date from the dtFrm calendar it sets the date on the dtTo calendar as expected. I just cant seem to set the EndDate of the dtTo calendar.
Anyone manage to solve this one?
Thanks! Lance
using:jquery.datePicker.min-2.1.2.js
<script type="text/javascript">
$(function() {
$('.dtFrm').datePicker({ inline: true })
.bind(
'dateSelected',
function(e, selectedDate, $td) {
$('.dtTo').dpSetSelected(selectedDate.addDays(10).asString());//works
$('.dtTo').dpSetEndDate(selectedDate.addDays(11).asString());//doesnt work
}
);
$('.dtTo').datePicker({ inline: true });
});
</script>
<div class="dtFrm" style="float:left"></div>
<div class="dtTo" style="float:left"></div>
© Stack Overflow or respective owner