Post by drors » Wed Apr 17, 2013 7:39 pm

In open cart there is an option to add field of type 'date'.
However when the calendar pops up I'm able to see dates in the past.
I want that the calendar will show only dates starting from the current day.
I therefore added the following parameter appears in bold but still calendar behaves the same.
$('.datetime').datetimepicker({
minDate: 0,
dateFormat: 'yy-mm-dd',
timeFormat: 'h:m'
How can i modify this script ?

New member

Posts

Joined
Wed Apr 17, 2013 6:45 pm

Post by daik01 » Wed Apr 17, 2013 8:36 pm

change the $('.date').datepicker({dateFormat: 'yy-mm-dd'}); instead of datetime.

TOP 5 Opencart Extensions:
1:Opencart Reservations
2:Stock Report, import/export stock levels with Excel
3:3D Carousel
4:Product Price Changer by Category
5:Set price Inclusive Taxes
DEMO SHOP


Active Member

Posts

Joined
Sun Oct 21, 2012 3:18 am


Post by drors » Thu Apr 18, 2013 12:17 am

Still doesn't work.
My block looks like this :
$('.date').datepicker({
minDate: 0,
dateFormat: 'yy-mm-dd',
});
But still i'm able to select dates from previous months

New member

Posts

Joined
Wed Apr 17, 2013 6:45 pm

Post by daik01 » Thu Apr 18, 2013 3:03 am

which page are you editing?
what version of opencart are you using?
are there errors when you debug?
are you using cache, empty it....

I tested it with 1.5.2.1 and it works fine

TOP 5 Opencart Extensions:
1:Opencart Reservations
2:Stock Report, import/export stock levels with Excel
3:3D Carousel
4:Product Price Changer by Category
5:Set price Inclusive Taxes
DEMO SHOP


Active Member

Posts

Joined
Sun Oct 21, 2012 3:18 am


Post by drors » Thu Apr 18, 2013 1:25 pm

I'm editing product.tpl , i'm using opencart 1.5.4 , i didn't encounter any errors.
I emptied the cache but there is no change.

New member

Posts

Joined
Wed Apr 17, 2013 6:45 pm

Post by daik01 » Thu Apr 18, 2013 3:40 pm

wow, that is strange, it works on my page...
are you using the right template product.tpl?

TOP 5 Opencart Extensions:
1:Opencart Reservations
2:Stock Report, import/export stock levels with Excel
3:3D Carousel
4:Product Price Changer by Category
5:Set price Inclusive Taxes
DEMO SHOP


Active Member

Posts

Joined
Sun Oct 21, 2012 3:18 am


Post by drors » Thu Apr 18, 2013 4:36 pm

i'm using the product.tpl found under
/catalog/view/theme/default/template/product

New member

Posts

Joined
Wed Apr 17, 2013 6:45 pm

Post by drors » Sun Apr 21, 2013 1:19 pm

I reinstalled opencart and now it's working.
Thanks for the help.

New member

Posts

Joined
Wed Apr 17, 2013 6:45 pm

Post by luizeduardo » Mon Feb 24, 2014 4:16 am

For option "date" worked percfectly for me!

Just added:

$('.date').datepicker({
minDate: 0,
dateFormat: 'dd-mm-yy',
});

On product.tpl on the current refered javascript on body section.
- i using brazilian date format (d-m-y) as you can see.

Thanks a lot!!

New member

Posts

Joined
Tue Jul 03, 2012 4:01 am
Who is online

Users browsing this forum: No registered users and 2 guests