Page 1 of 1

Close Calendar Previous Dates 4.1.0.0

Posted: Sun Jun 15, 2025 10:28 pm
by lahoregifts
Options Appear on product page. I have Delivery Date. On Calendar i want to customer should not be able to select previous dates. can i control current date with cut off time.
Is there any solution other than extension. Version 4.1.0.0

Re: Close Calendar Previous Dates 4.1.0.0

Posted: Sun Jun 15, 2025 10:58 pm
by by mona
Untested but you could try adding this to your catalog/view/theme/default/template/product/product.twig file. Before {{ footer }}
Double check that it has no datepicker function already, it will be somewhere at the end of the file. It used to be in the product file.

Code: Select all

<script>
   $(document).ready(function () {
        $('#datepicker').datepicker({
            startDate: new Date()
        });
    });
    </script>
A quick google search gave another solution you could try

Code: Select all

<script>
$(document).ready(function () {
$('#datetimepicker').datetimepicker({  
 minDate:new Date(),
 disabledDates: [new Date()]
});
  });
    </script>