fix a bug when printing calendars, add a unit test
							parent
							
								
									50d4eb27bf
								
							
						
					
					
						commit
						9548b7bdd8
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue