1

In backend i added date and time

<script type="text/javascript">
    // <![CDATA[
    Calendar.setup({
    inputField : 'shipping_pickup_at_store_date',
    ifFormat : '%d-%m-%Y',
    showsTime: false,
    button : 'shipping_pickup_at_store_date',
    singleClick : true,
    disableFunc: function(date) {
    //disable previous day in datepicker
        var now= new Date();
        if(date.getFullYear()<now.getFullYear())
        {
            return true;
        }
        if(date.getFullYear()==now.getFullYear())
        {
            if(date.getMonth()<now.getMonth())
            {
                return true;
            }
        }
        if(date.getMonth()==now.getMonth())
            {
            if(date.getDate()<now.getDate())
            {
                return true;
            }
        }
    },
    });
    // ]]>
</script>

in DataPicker it shows date and time if i select in my textbox it will show only data how i show time

Also I can't able to choose current month date

1
  • Did you get solution for your problem? @kothari Commented Apr 18, 2017 at 16:02

1 Answer 1

0

Use only below code, It will add time and allow to select dates from current month.

<script type="text/javascript">
    // <![CDATA[
    Calendar.setup({
    inputField : 'shipping_pickup_at_store_date',
    ifFormat : '%d-%m-%Y %H:%M',
    showsTime: true,
    button : 'shipping_pickup_at_store_date',
    singleClick : true,
    });
    // ]]>
</script>
3
  • it's come like this 19-05-2017 %h:05
    – Magento 2
    Commented Apr 9, 2017 at 19:43
  • i can't able to select current month
    – Magento 2
    Commented Apr 9, 2017 at 20:36
  • Please check updated code Commented Apr 10, 2017 at 2:36

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.