diff options
author | EXetoC <exetoc@gmail.com> | 2014-02-06 14:18:44 +0100 |
---|---|---|
committer | EXetoC <exetoc@gmail.com> | 2014-02-06 14:18:44 +0100 |
commit | 38e4dfc164404a601e0556936497e7ee97a88fba (patch) | |
tree | 4419938eb8e3324f9063d3bdd7db7559f6a2edbd /lib | |
parent | 96e616198d100f0e10337c0210b088730d66d91e (diff) | |
download | Nim-38e4dfc164404a601e0556936497e7ee97a88fba.tar.gz |
Export procs that are useful elsewhere.
Diffstat (limited to 'lib')
-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 |