Issue with setPlannerValue

I discovered an issue with the setPlannerValue method in scalplanner.js

The issue is when the current day is not in the month that is being set.

Example:
Today is 4/30/08
Passing in 2008, 2, 1, 'Test'
var planvalues = Object.isArray(value) ? value : [value];
var plannerdate = new Date(); // setup to 4/30/08
plannerdate.setHours(0, 0, 0, 0);
plannerdate.setYear(year);
plannerdate.setMonth(month - 1); //attempts to set month to 1 but fails...
//day is initialized to 30, 30th day does exist in feb 08
//therefore the month change fails
plannerdate.setDate(day);

Suggested Fix:

Change plannerdate.setMonth(month - 1); to plannerdate.setMonth(month - 1, 1);
Sets day which is set again after the month, without problems.

Is the Google Code version

Is the Google Code version of svn up to date?
For 2.01 and trunk versions they both show setMonth(month-1), otherwise I wouldn't have noted.
Thanks regardless.

setPlannerValue SVN Updated

jamiegrove's picture

Thanks for noting that. I had the 2.0 version up to date but not the v2.01. Looking in the wrong directory. Doh!

Trunk and branches should now be up to date. Thanks again!

- Jamie

setPlannerValue fixed

jamiegrove's picture

Looks like this was already in the SVN version. I will update the ZIP download the reflect the change immediately. Thanks!!!!!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options