11-30-2017, 04:21 AM,
(This post was last modified: 12-04-2017, 07:04 AM by phil.)
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
Calendar Date Picker - Off by One Month? SOLVED
Locale USA
Whenever I click on a date field to pop the Calendar Date Picker it is off by one month (+30 days).
Is this expected functionality and, if not, how can I make it so the Calendar Date Picker defaults to the date shown in the date fields?
Is this a MiscFunctions.js thing?
https://www.linkedin.com/in/eclipsepaulbecker
|
|
11-30-2017, 05:10 AM,
(This post was last modified: 11-30-2017, 05:38 AM by VortecCPI.)
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: Calendar Date Picker - Off by One Month?
After looking at MiscFunctions.js I believe this is a locale issue.
Trying to resolve it now...
(11-30-2017, 05:06 AM)falkoner Wrote: Which script is it, or all? Some scripts have the date field set for 30 days hence or 30 days before.
Tim
It happens in every date field I have tried so far. I assume the calendar should default to the month for the dates shown in the date fields?
https://www.linkedin.com/in/eclipsepaulbecker
|
|
11-30-2017, 10:37 PM,
(This post was last modified: 11-30-2017, 10:38 PM by VortecCPI.)
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: Calendar Date Picker - Off by One Month?
I made two small changes in MiscFunctions.js and it seems to work as I need it to now.
drawCalendar(md, dt.getFullYear(), dt.getMonth()-1, dt.getDate()+1, dF);
A hack for sure but it gets me where I need to be for now...
https://www.linkedin.com/in/eclipsepaulbecker
|
|
12-02-2017, 02:56 AM,
(This post was last modified: 12-02-2017, 03:13 AM by TimSchofield.)
|
|
TimSchofield
Tim Schofield
|
Posts: 1,318
Threads: 22
Joined: Mar 2015
|
|
RE: Calendar Date Picker - Off by One Month?
The problem is this then shows the wrong date for d/m/Y date formats.
I need to find time to properly look into this.
Tim
(12-02-2017, 02:56 AM)falkoner Wrote: The problem is this then shows the wrong date for d/m/Y date formats.
I need to find time to properly look into this.
Tim
Turned out to be easier than I expected. Change lines 252/253 of javascripts/MiscFunctions.js to be the following:
m = parseInt(dA[0], 10)-1;
d = parseInt(dA[1], 10);
Thanks
Tim
|
|
12-02-2017, 06:15 AM,
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: Calendar Date Picker - Off by One Month?
Thank you Tim!
https://www.linkedin.com/in/eclipsepaulbecker
|
|
12-03-2017, 12:18 AM,
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: Calendar Date Picker - Off by One Month?
Thank you both for your help and for committing changes.
https://www.linkedin.com/in/eclipsepaulbecker
|
|
|