comparison calendar.ur @ 26:86857ae0f386

Change more dashes to slashes, for JavaScript compatibility
author Adam Chlipala <adam@chlipala.net>
date Fri, 09 Dec 2011 17:38:20 -0500
parents a037ed3854e3
children 5905b56e0cd9
comparison
equal deleted inserted replaced
25:a037ed3854e3 26:86857ae0f386
57 f (n+1) next 57 f (n+1) next
58 else 58 else
59 n 59 n
60 end 60 end
61 in 61 in
62 f 28 (readError (show m.Year ^ "-" ^ pad 2 m.Month ^ "-28 00:00:00")) 62 f 28 (readError (show m.Year ^ "/" ^ pad 2 m.Month ^ "/28 00:00:00"))
63 end 63 end
64 64
65 fun weekdayToNum s = 65 fun weekdayToNum s =
66 case s of 66 case s of
67 "Mon" => 0 67 "Mon" => 0
72 | "Sat" => 5 72 | "Sat" => 5
73 | "Sun" => 6 73 | "Sun" => 6
74 | _ => error <xml>Datebox: Bad weekday name</xml> 74 | _ => error <xml>Datebox: Bad weekday name</xml>
75 75
76 fun timeOfMonth my = 76 fun timeOfMonth my =
77 readError (show my.Year ^ "-" ^ pad 2 my.Month ^ "-01 00:00:00") 77 readError (show my.Year ^ "/" ^ pad 2 my.Month ^ "/01 00:00:00")
78 78
79 fun monthInfo' this = 79 fun monthInfo' this =
80 let 80 let
81 val prev = if this.Month = 1 then 81 val prev = if this.Month = 1 then
82 {Month = 12, Year = this.Year - 1} 82 {Month = 12, Year = this.Year - 1}