Page 1 of 1

[SOLVED] How to set mindate in datepicker OC3

Posted: Thu Jun 07, 2018 5:43 pm
by lightworks
Anyone any idea how to set the datepicker mindate in OC3? Thanks.

Re: How to set mindate in datepicker OC3

Posted: Sun Jun 10, 2018 10:51 pm
by straightlight
After the:

Code: Select all

<div class="input-group date">
line on the TWIG file, ensure to have the:

Code: Select all

data-date-format="YYYY-MM-DD" data-locale="{{ datepicker }}"
portion added after the: placeholder="x". Then, at the bottom of the TWIG file, add:

Code: Select all

<script type="text/javascript"><!--
$('.date').datetimepicker({
	language: '{{ datepicker }}',
	pickTime: false
});

$('.time').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: false
});

$('.datetime').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: true,
	pickTime: true
});
//--></script>
(normally above the {{ footer }} variable). This should do it.

Re: How to set mindate in datepicker OC3

Posted: Thu Apr 23, 2020 12:09 pm
by sham1987
hi,
i have tried this solution to disable the previous date from the datetime picker in the delivery option for the product, but it is not working. can you plz help me i am new to OC 3
i have modified this file:
catalog/view/theme/default/template/product/product.twig

Re: How to set mindate in datepicker OC3

Posted: Thu Apr 23, 2020 2:49 pm
by OSWorX
Has nothing todo with OpenCart, you should read this here:
https://eonasdan.github.io/bootstrap-datetimepicker/

Re: How to set mindate in datepicker OC3

Posted: Fri Apr 24, 2020 10:22 am
by sham1987
thanks, it works now... i was doing my changes in the product.twig file directly(and i save it), but somehow the changes never reflected, i have to go to theme editor and open the file and save it then i can see the changes