Forums / All Other Contributions/Addons / Help with Delivery Date Picker to activate today

Help with Delivery Date Picker to activate today

Views: 2,200

Results 1 to 3 of 3
23 Mar 2010, 5:50 PM
#1
digitalguard avatar

digitalguard

Zen Follower

Join Date:
Nov 2007
Posts:
121
Plugin Contributions:
0

Help with Delivery Date Picker to activate today

Hello,

I got the Delivery Date Picker 1 Calender working, Everything is good except I can not activate today's date.

Here is a copy of my code

Can any1 please take a look and tell me what I'm doing wrong that it wont let me select todays date.

I really appreciate it.

Thanks
DigitalGuard

31 Mar 2010, 3:48 AM
#2
enchantedneedle avatar

enchantedneedle

New Zenner

Join Date:
Jan 2008
Posts:
74
Plugin Contributions:
0

Re: Help with Delivery Date Picker to activate today

I'm not sure it will ever allow today's date as a delivery date. Have you look through all the documentation of the original author's site?
BTW, did you get it to show the calendar in FF? I can not get it to show up.

Tammy
https://www.EnchantedCostumes.com
Zen Cart 1.3.9h

29 Jan 2011, 6:27 PM
#3
anthonyg avatar

anthonyg

New Zenner

Join Date:
Sep 2010
Posts:
5
Plugin Contributions:
0

Re: Help with Delivery Date Picker to activate today

Works perfectly in FF (FF is my default browser for developing SCW & JACS). SCW is fully cross-browser. If you have a problem with it, ask for help at [email protected] (as per the header of the script).

The relevant bit of your edited script is:

scwDisabledDates[0] = [new Date(scwDateNow.getFullYear()-1, scwDateNow.getMonth(), scwDateNow.getDate()), new Date(scwDateNow) ];

This disables dates from exactly one year ago today through to today.

First, as scwDateNow is a javascript date already, that code should be:

scwDisabledDates[0] = [new Date(scwDateNow.getFullYear()-1, scwDateNow.getMonth(), scwDateNow.getDate()), scwDateNow];

However, to make it disable up to yesterday (instead of up to today) you would need:

scwDisabledDates[0] = [new Date(scwDateNow.getFullYear()-1, scwDateNow.getMonth(), scwDateNow.getDate()), new Date(scwDateNow.getFullYear(), scwDateNow.getMonth(), scwDateNow.getDate()-1)];

...and you are also setting scwDisabledDates[1] as a date range of today through to today... so take that out or today will remain disabled whatever you do to scwDisabledDates[0].