fix a bug when printing calendars, add a unit test

db4
Doug Coleman 2009-10-12 16:55:52 -05:00
parent 50d4eb27bf
commit 9548b7bdd8
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
USING: calendar.format calendar kernel math tools.test
io.streams.string accessors io math.order ;
io.streams.string accessors io math.order sequences ;
IN: calendar.format.tests
[ 0 ] [
@ -81,3 +81,5 @@ IN: calendar.format.tests
] [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test
[ ]
[ { 2008 2009 } [ year. ] each ] unit-test

View File

@ -66,7 +66,7 @@ M: array month. ( pair -- )
[ month-name write bl number>string print ]
[ 1 zeller-congruence ]
[ (days-in-month) day-abbreviations2 " " join print ] 2tri
over " " <repetition> concat write
over " " <repetition> "" concat-as write
[
[ 1 + day. ] keep
1 + + 7 mod zero? [ nl ] [ bl ] if