diff options
author | Araq <rumpf_a@web.de> | 2014-02-09 00:58:30 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-09 00:58:30 +0100 |
commit | 783095a100a2ae11745dcda50d99e99ab85f3afd (patch) | |
tree | 9eab01fdedb305307d03b972280de3a21759e0c8 | |
parent | 0965351792a07068a504458ff88e3ae794517345 (diff) | |
parent | a70235daaa2b73bfc04fa53583be56adefd1deb8 (diff) | |
download | Nim-783095a100a2ae11745dcda50d99e99ab85f3afd.tar.gz |
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
-rw-r--r-- | lib/pure/times.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 6186fcad8..de6c4e4fa 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -211,7 +211,9 @@ proc initInterval*(miliseconds, seconds, minutes, hours, days, months, result.months = months result.years = years -proc isLeapYear(year: int): bool = +proc isLeapYear*(year: int): bool = + ## returns true if ``year`` is a leap year + if year mod 400 == 0: return true elif year mod 100 == 0: @@ -221,7 +223,9 @@ proc isLeapYear(year: int): bool = else: return false -proc getDaysInMonth(month: TMonth, year: int): int = +proc getDaysInMonth*(month: TMonth, year: int): int = + ## gets the amount of days in a ``month`` of a ``year`` + # http://www.dispersiondesign.com/articles/time/number_of_days_in_a_month case month of mFeb: result = if isLeapYear(year): 29 else: 28 |