diff tests/timef.ur @ 1609:c6cc104a47ac

Client-side timef
author Adam Chlipala <adam@chlipala.net>
date Thu, 24 Nov 2011 11:27:51 -0500
parents
children 7d459f223ac2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/timef.ur	Thu Nov 24 11:27:51 2011 -0500
@@ -0,0 +1,12 @@
+fun main () : transaction page =
+    date <- source "";
+    format <- source "";
+    return <xml><body>
+      <ctextbox source={date}/>
+      <ctextbox source={format}/>
+      <dyn signal={d <- signal date;
+                   f <- signal format;
+                   return (case read d of
+                               None => <xml/>
+                             | Some d => <xml>{[timef f d]}</xml>)}/>
+    </body></xml>