-1

I have code that implements a calendar:

$( function() {
    var dateFormat = "mm/dd/yy",
    from = $( "#fromdate" ).datepicker({
        minDate:0,
        changeMonth: true
    }).on( "change", function() {
        to.datepicker( "option", "minDate", getDate( this ) );
    }),
    to = $( "#todate" ).datepicker({
        defaultDate: "+1w",
        changeMonth: true
    }).on( "change", function() {
        from.datepicker( "option", "minDate", getDate( this ) );
    });

    function getDate( element ) {
        var date;
        try {
            date = $.datepicker.parseDate( dateFormat, element.value );
        } catch( error ) {
            date = null;
        }
        return date;
    }
});

I have the #fromdate and #todate HTML elements. I want #fromdate to select the current date (it does that), and #todate to add 10 days to it (this doesn't work), and show it on the calendar.

MultiplyByZer0
  • 6,302
  • 3
  • 32
  • 48

1 Answers1

-1

try this code

$date = strtotime($date);
$date = strtotime("+10 day", $date);
echo date('M d, Y', $date);