comparison calendar.ur @ 31:b5432d74841a

Update for key/mouse handler change
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 10:15:14 -0400
parents 93140c5cc972
children
comparison
equal deleted inserted replaced
30:c1f06342c81f 31:b5432d74841a
132 cday <- SourceL.value t.Day; 132 cday <- SourceL.value t.Day;
133 return (if thisDate = cday then 133 return (if thisDate = cday then
134 <xml><td class={selday}>{[day]}</td></xml> 134 <xml><td class={selday}>{[day]}</td></xml>
135 else case month of 135 else case month of
136 This => <xml><td class={curday} 136 This => <xml><td class={curday}
137 onclick={SourceL.set t.Day thisDate}>{[day]}</td></xml> 137 onclick={fn _ => SourceL.set t.Day thisDate}>{[day]}</td></xml>
138 | _ => <xml><td class={otherday}>{[day]}</td></xml>) 138 | _ => <xml><td class={otherday}>{[day]}</td></xml>)
139 end}/> 139 end}/>
140 {let 140 {let
141 val (year, month, day) = 141 val (year, month, day) =
142 case month of 142 case month of
179 in 179 in
180 return <xml> 180 return <xml>
181 <table class={calendar}> 181 <table class={calendar}>
182 <tr> 182 <tr>
183 <th class={prev} colspan={2} 183 <th class={prev} colspan={2}
184 onclick={minf <- rpc (monthInfo (if minf.ThisMonth = 1 then 184 onclick={fn _ => minf <- rpc (monthInfo (if minf.ThisMonth = 1 then
185 {Month = 12, Year = minf.Year - 1} 185 {Month = 12, Year = minf.Year - 1}
186 else 186 else
187 {Month = minf.ThisMonth - 1, Year = minf.Year})); 187 {Month = minf.ThisMonth - 1, Year = minf.Year}));
188 set t.Month minf}>&lt;&lt; {[minf.PrevMonthName]}</th> 188 set t.Month minf}>&lt;&lt; {[minf.PrevMonthName]}</th>
189 <th class={this} colspan={3}>{[minf.ThisMonthName]} {[minf.Year]}</th> 189 <th class={this} colspan={3}>{[minf.ThisMonthName]} {[minf.Year]}</th>
190 <th class={next} colspan={2} 190 <th class={next} colspan={2}
191 onclick={minf <- rpc (monthInfo (if minf.ThisMonth = 12 then 191 onclick={fn _ => minf <- rpc (monthInfo (if minf.ThisMonth = 12 then
192 {Month = 1, Year = minf.Year + 1} 192 {Month = 1, Year = minf.Year + 1}
193 else 193 else
194 {Month = minf.ThisMonth + 1, Year = minf.Year})); 194 {Month = minf.ThisMonth + 1, Year = minf.Year}));
195 set t.Month minf}>{[minf.NextMonthName]} >></th> 195 set t.Month minf}>{[minf.NextMonthName]} >></th>
196 </tr> 196 </tr>
197 <tr class={weekday}> <th>M</th> <th>Tu</th> <th>W</th> <th>Th</th> <th>F</th> <th>Sa</th> <th>Su</th> </tr> 197 <tr class={weekday}> <th>M</th> <th>Tu</th> <th>W</th> <th>Th</th> <th>F</th> <th>Sa</th> <th>Su</th> </tr>
198 {rows (if minf.ThisMonth = 1 && (case minf.MondayMonth of This => False | _ => True) then 198 {rows (if minf.ThisMonth = 1 && (case minf.MondayMonth of This => False | _ => True) then
199 minf.Year - 1 199 minf.Year - 1
200 else 200 else