rmbruijn@19: con t other_ctx = {Cal : Calendar.t,
rmbruijn@19: Panel : TogglePanel.togglePanel Calendar.t other_ctx}
adam@2:
kkallio@14: type date = Calendar.date
kkallio@14: val date_eq = Calendar.date_eq
kkallio@14: val date_ord = Calendar.date_ord
kkallio@14: val time = Calendar.time
kkallio@14: val date = Calendar.date
adam@2:
rmbruijn@19: (* : other_ctx:::{Unit} -> [other_ctx ~ body] => formatCtl other_ctx *)
rmbruijn@19:
rmbruijn@19: val format = TogglePanel.defaultFormat
kkallio@14: --#OpenCtl -- #CloseCtl
kkallio@14: ++ {OpenCtl = fn behaviour => ,
kkallio@14: CloseCtl = fn behaviour => }
adam@3:
adam@4: fun create tm =
kkallio@14: cal <- Calendar.create tm;
kkallio@14: panel <- TogglePanel.create format cal False;
adam@2:
kkallio@14: return {Cal = cal,
kkallio@14: Panel = panel}
adam@2:
adam@15: fun onChange db f =
adam@15: Calendar.onChange db.Cal f
adam@4:
kkallio@14: fun set db day =
kkallio@14: Calendar.set db.Cal day
kkallio@12:
kkallio@14: fun value db = Calendar.value db.Cal
kkallio@12:
kkallio@14: fun render db =
kkallio@12:
kkallio@14: {[date.Year]}-{[date.Month]}-{[date.Day]}}/>
kkallio@14: {Gui.toXml db.Panel}
kkallio@12: