Upload version 1.0

This commit is contained in:
Thijs Schreijer
2013-05-04 17:28:38 +02:00
parent 4e0dd3f8c2
commit db859d3555
7 changed files with 1438 additions and 3 deletions

23
samples/test.lua Normal file
View File

@@ -0,0 +1,23 @@
require 'date'
d1 = date('July 4 2009')
assert(d1:getmonth() == 7)
d2 = d1:copy()
d2:adddays(2)
diff = d2 - d1
assert(diff:spandays() == 2)
assert(diff:spanhours() == 48)
assert(date 'July 4 2009' == date '2009-07-04')
a = date(1970, 1, 1)
y, m, d = a:getdate()
assert(y == 1970 and m == 1 and d == 1)
d = date(1966, 'sep', 6)
assert(d:getday() == 6)