From c4e0d16253966f2884f9144a3d2d628c06624842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20K=C5=99ivka?= Date: Fri, 20 Dec 2024 11:59:28 +0100 Subject: [PATCH] =?UTF-8?q?docs(input-schema-specs):=20add=20example=20pat?= =?UTF-8?q?tern=20regex=20for=20full=20ISO=20date=E2=80=A6=20(#1353)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 <92638966+TC-MO@users.noreply.github.com> --- .../actor_definition/input_schema/specification.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sources/platform/actors/development/actor_definition/input_schema/specification.md b/sources/platform/actors/development/actor_definition/input_schema/specification.md index e6a8b63d8..d9e14cb70 100644 --- a/sources/platform/actors/development/actor_definition/input_schema/specification.md +++ b/sources/platform/actors/development/actor_definition/input_schema/specification.md @@ -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: