Post by lightworks » Thu Jun 07, 2018 5:43 pm

Anyone any idea how to set the datepicker mindate in OC3? Thanks.

Newbie

Posts

Joined
Sat Jul 21, 2012 6:51 am

Post by straightlight » Sun Jun 10, 2018 10:51 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sham1987 » Thu Apr 23, 2020 12:09 pm

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

Newbie

Posts

Joined
Fri Apr 10, 2020 9:42 pm

Post by OSWorX » Thu Apr 23, 2020 2:49 pm

Has nothing todo with OpenCart, you should read this here:
https://eonasdan.github.io/bootstrap-datetimepicker/

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by sham1987 » Fri Apr 24, 2020 10:22 am

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

Newbie

Posts

Joined
Fri Apr 10, 2020 9:42 pm
Who is online

Users browsing this forum: Adminas99999 and 171 guests