Date isLeapYear + totalDaysInMonth #72

Merged
merged 4 commits into from Apr 4, 2013

3 participants

@millermedeiros
Modular JavaScript Utilities member

these methods are useful when building calendars. see #28

@MathiasPaumgarten
Modular JavaScript Utilities member

Indeed very useful. I had to implement the leap year module before a few times. never sure I got it right :)

@conradz conradz commented on an outdated diff Apr 3, 2013
@@ -4,6 +4,19 @@ Date utilities.
+## isLeapYear(fullYear|date):Boolean
+
+Checks if it's a [leap year](http://en.wikipedia.org/wiki/Leap_year).
@conradz
Modular JavaScript Utilities member
conradz added a note Apr 3, 2013

Probably should specify that this is checking for a leap year according to the Gregorian calendar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@conradz conradz commented on an outdated diff Apr 3, 2013
@@ -31,6 +44,19 @@ parseIso('2000-01-02T20:10+04:00') // 946829400000
```
+## totalDaysInMonth(fullYear, monthIndex):Number
+
+Returns the amount of days in the month taking into consideration leap years.
@conradz
Modular JavaScript Utilities member
conradz added a note Apr 3, 2013

Also here probably should specify Gregorian calendar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@conradz
Modular JavaScript Utilities member

+1 Other than my comments on the docs, LGTM.

@millermedeiros millermedeiros merged commit dd32131 into mout:master Apr 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment