2
0

(setVariable) Add timezone option for dates

Closes #1251
This commit is contained in:
Baptiste Arnaud
2024-02-16 10:07:29 +01:00
parent 07240e6d4b
commit 3e0d3e7724
9 changed files with 250 additions and 33 deletions

View File

@@ -13,9 +13,6 @@ const baseOptions = z.object({
const basicSetVariableOptionsSchema = baseOptions.extend({
type: z.enum([
'Today',
'Now',
'Yesterday',
'Tomorrow',
'Moment of the day',
'Empty',
'Environment name',
@@ -26,6 +23,11 @@ const basicSetVariableOptionsSchema = baseOptions.extend({
]),
})
const dateSetVariableOptionsSchema = baseOptions.extend({
type: z.enum(['Now', 'Yesterday', 'Tomorrow']),
timeZone: z.string().optional(),
})
const initialSetVariableOptionsSchema = baseOptions.extend({
type: z.undefined().openapi({ type: 'string' }),
expressionToEvaluate: z.string().optional(),
@@ -56,6 +58,7 @@ const appendItemToListOptionsSchema = baseOptions.extend({
export const setVariableOptionsSchema = z.discriminatedUnion('type', [
initialSetVariableOptionsSchema,
dateSetVariableOptionsSchema,
basicSetVariableOptionsSchema,
customSetVariableOptionsSchema,
mapListItemsOptionsSchema,