0

When we open date calendar, it shows current date selected by default. But I need to show a date selected which is 15 days ahead of current date.

My code

HTML:

<input type="text" class="input-text" id="delivery_date" name="delivery_date">

Script:

   Calendar.setup({
                inputField: "delivery_date",
                ifFormat: "%d/%m/%Y",
                showsTime: false,
                button: "delivery_date_trig",
                align: "Bl",
                singleClick : true
            })

Thanks.

4
  • $("#delivery_date" ).datepicker("option", "defaultDate", +15);
    – dh47
    Commented Dec 22, 2014 at 9:24
  • I cannot use datepicker. I need to use magento's default calendar only. Commented Dec 22, 2014 at 9:32
  • In which page actually you want this?
    – dh47
    Commented Dec 22, 2014 at 9:33
  • $Today=date('y:m:d'); $NewDate=Date('y:m:d', strtotime("+15 days"));
    – dh47
    Commented Dec 22, 2014 at 12:21

1 Answer 1

2

not sure about this, but I think you can pass a dateText param to the setup.

Calendar.setup({
            inputField: "delivery_date",
            ifFormat: "%d/%m/%Y",
            showsTime: false,
            button: "delivery_date_trig",
            align: "Bl",
            singleClick : true,
            dateText: 'your date here'
        })

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.