io.input.datetime
A date and a time, the same instant everywhere.
io.input.datetime asks for a date and a time, such as when a trial ends. The person picks it in their own time zone, which is shown under the field. The handler gets a luxon DateTime in UTC. It is the same instant whatever time zone the person is in.
The simplest one
The whole action file, and roughly what your team sees when it runs.
Extend trial
What you can set
The settings you will reach for most, each with the line of code that turns it on.
The time zone, shown. The field works in the browser’s time zone and names it under the field. Nobody has to convert in their head.
Earliest and latest. Set the first and last time that can be picked. The server checks every answer, to the minute.
A starting value. Pass a luxon DateTime, a JavaScript Date or an ISO 8601 string. Without one the field starts empty.
A luxon DateTime back. It comes in UTC. Convert it with .setZone() for local time, or store it with .toISO().
Optional. The field is required by default. With .optional() it can stay empty and the handler gets undefined.
Your own check. .validate() gets the DateTime on the server. Return a message, such as one for a call outside office hours.
More in the docs
This page shows the idea. The docs have every prop, the checks on the server and more examples.
Next components
Three more calls on io. Each one shows a control and hands your code a typed value.
Write your first tool today.
An async function, a few await calls, and the form is in the browser.