| Issue 39: | [FIXED] TimePeriod for two dates is broken | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Create a new TimePeriod object for two dates 2. var foo = TimePeriod(Date.today(), Date.today()); What is the expected output? What do you see instead? expected: foo should be an object actual: the error d1.getDaysInMonth() is not a function What version of the product are you using? On what operating system? Latest SVN nightly (as of May 7th, 2008) Please provide any additional information below. The problem is that lines 245 and 251 of time.js are using: d1.getDaysInMonth() However, getDaysInMonth is a static function, not an instance method. Changing the line: d1.getDaysInMonth() to Date.getDaysInMonth(d1.getYear(), d1.getMonth()) fixes the problem |
|
,
May 07, 2008
Thanks for pointing out the bug. I've fixed the problem in TimePeriod and updated SVN (Build #189). Example var start = new Date(); var end = Date.today().add(15).days(); var ts = new TimePeriod(start, end); ts.getDays(); // 14
Summary: [FIXED] TimePeriod for two dates is broken
Status: Fixed |
|
| ► Sign in to add a comment |