Skip to content

Commit c4e0d16

Browse files
docs(input-schema-specs): add example pattern regex for full ISO date… (#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]>
1 parent 8c0df15 commit c4e0d16

File tree

1 file changed

+8
-0
lines changed
  • sources/platform/actors/development/actor_definition/input_schema

1 file changed

+8
-0
lines changed

sources/platform/actors/development/actor_definition/input_schema/specification.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ When using escape characters `\` for the regular expression in the `pattern` fie
244244

245245
:::
246246

247+
#### Advanced date and time handling
248+
249+
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:
250+
251+
`"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?$"`
252+
253+
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.
254+
247255
### Boolean
248256

249257
Example options with group caption:

0 commit comments

Comments
 (0)