Jump to content

set $todate dynamically not working in calendar


dflow

Recommended Posts

i want to get the $todate to start after the choosen $fromdate :confused:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="/datepick/jquery.datepick.css" media="screen" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
<script type="text/javascript" src="/datepick/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
//	$('#fromdate').datepick({showOn: 'both',
//    buttonImageOnly: true, buttonImage: '../js/datepick/calendar2.png', dateFormat:'dd.mm.yy',yearRange:'+0:+5'});
//    $('#todate').datepick({showOn: 'both',
//    buttonImageOnly: true, buttonImage: '../js/datepick/calendar2.png', dateFormat:'dd.mm.yy',yearRange:'+0:+5'});
jQuery('#fromdate,#todate').datepick({
            beforeShow: customRange,
            showOn: 'both',
            buttonImageOnly: true,
            buttonImage: '../datepick/calendar-blue.gif',
            dateFormat:'dd-mm-yyyy',
            yearRange:'+0:+5'});

        function customRange(input) {
            return {minDate: (input.id == 'todate' ?
                $('#fromdate').datepick('getDate') : +1),
                maxDate: (input.id == 'fromdate' ?
                $('#todate').datepick('getDate') : null)};
        }
});
</script>






  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.