Skip to content

Commit

Permalink
docs(input-schema-specs): add example pattern regex for full ISO date… (
Browse files Browse the repository at this point in the history
#1353)

See discussion:
https://apify.slack.com/archives/C01E7CSJ2PP/p1734018697179259

Not sure if this is the best place to put it.

---------

Co-authored-by: Michał Olender <[email protected]>
  • Loading branch information
metalwarrior665 and TC-MO authored Dec 20, 2024
1 parent 8c0df15 commit c4e0d16
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ When using escape characters `\` for the regular expression in the `pattern` fie

:::

#### Advanced date and time handling

While the `datepicker` editor doesn't support setting time values visually, you can allow users to handle more complex datetime formats and pass them via JSON. The following regex allows users to optionally extend the date with full ISO datetime format or pass `hours` and `minutes` as a relative date:

`"pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?Z?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$"`

When implementing time-based fields, make sure to explain to your users through the description that the time values should be provided in UTC. This helps prevent timezone-related issues.

### Boolean

Example options with group caption:
Expand Down

0 comments on commit c4e0d16

Please sign in to comment.