Skip to content

Instantly share code, notes, and snippets.

@kubaPod
Last active December 28, 2020 11:19
Show Gist options
  • Save kubaPod/4ed816feba54d96a4d2cd5a84f86743a to your computer and use it in GitHub Desktop.
Save kubaPod/4ed816feba54d96a4d2cd5a84f86743a to your computer and use it in GitHub Desktop.
How to use native datetime (datetime-local) input as Wolfram Mathematica / Wolfram Cloud FormFunction field's control (as opposed to a smart input field).


FormFunction[{
  "date" -> <|
    "Interpreter" -> "String",
    "Control"     -> Function @ EmbeddedHTML @ StringTemplate[
        "<input type='datetime-local' id='id_`1`', name='`1`' value=`2` step='1'>"
     ]["date", DateString["ISODateTime"] ]
  |>
}
, ToString @ DateObject @ #date&
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment