From c25d2d53a44bdfd6bc0daf5f4ab8c793613f734b Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Tue, 24 Dec 2024 10:08:45 +0530 Subject: [PATCH 1/2] feat(core): add timeinterval for the interval trigger in workflow --- .../src/lib/builder/builder.component.ts | 3 +- .../src/lib/builder/group/group.component.ts | 11 +++- .../classes/nodes/abstract-prompt.class.ts | 6 ++ projects/workflows-creator/src/lib/const.ts | 2 +- projects/workflows-creator/src/lib/enum.ts | 16 ++++- .../bpmn/elements/gateways/gateway.element.ts | 2 +- .../bpmn/elements/process/process.element.ts | 2 +- .../create/basic-interval-create.strategy.ts | 59 +++++++++++++++++-- .../strategies/create/task-create.strategy.ts | 2 +- .../strategies/link/gateway-link.strategy.ts | 1 + .../link/or-gateway-link.strategy.ts | 2 +- .../statement/events/oninterval.event.ts | 10 +++- .../statement/events/onvalue.event.ts | 2 +- .../lib/services/statement/inputs/index.ts | 5 +- .../statement/inputs/interval.input.ts | 4 +- .../statement/inputs/stepper.input.ts | 21 +++++++ .../statement/inputs/timeinterval.input.ts | 30 ++++++++++ .../statement/inputs/tointerval.input.ts | 30 ++++++++++ .../src/lib/workflow-builder.module.ts | 10 +++- 19 files changed, 197 insertions(+), 21 deletions(-) create mode 100644 projects/workflows-creator/src/lib/services/statement/inputs/stepper.input.ts create mode 100644 projects/workflows-creator/src/lib/services/statement/inputs/timeinterval.input.ts create mode 100644 projects/workflows-creator/src/lib/services/statement/inputs/tointerval.input.ts diff --git a/projects/workflows-creator/src/lib/builder/builder.component.ts b/projects/workflows-creator/src/lib/builder/builder.component.ts index fd2dec2..d779b16 100644 --- a/projects/workflows-creator/src/lib/builder/builder.component.ts +++ b/projects/workflows-creator/src/lib/builder/builder.component.ts @@ -373,7 +373,8 @@ export class BuilderComponent implements OnInit, OnChanges { ) { if ( ((value as AllowedValuesMap)?.value as AllowedValuesMap)?.value === - ValueTypes.AnyValue || ((value as AllowedValuesMap)?.value === ValueTypes.AnyValue) + ValueTypes.AnyValue || + (value as AllowedValuesMap)?.value === ValueTypes.AnyValue ) { /** * Remove node on changes event diff --git a/projects/workflows-creator/src/lib/builder/group/group.component.ts b/projects/workflows-creator/src/lib/builder/group/group.component.ts index 104c5be..a091558 100644 --- a/projects/workflows-creator/src/lib/builder/group/group.component.ts +++ b/projects/workflows-creator/src/lib/builder/group/group.component.ts @@ -213,7 +213,13 @@ export class GroupComponent implements OnInit, AfterViewInit { [InputTypes.Email]: this.templateMap?.[InputTypes.Email] || this.emailTemplate, [InputTypes.OptionList]: - this.templateMap?.[InputTypes.OptionList] || this.listTemplate, + this.templateMap?.[InputTypes.OptionList] || this.listTemplate, + [InputTypes.Stepper]: + this.templateMap?.[InputTypes.Stepper] || this.listTemplate, + [InputTypes.IntervalDate]: + this.templateMap?.[InputTypes.IntervalDate] || this.listTemplate, + [InputTypes.IntervalTime]: + this.templateMap?.[InputTypes.IntervalTime] || this.listTemplate, }; } @@ -400,7 +406,8 @@ export class GroupComponent implements OnInit, AfterViewInit { element, input, input.setValue(element.node.state, value), - input.typeFunction(element.node.state) === InputTypes.List || input.typeFunction(element.node.state) === InputTypes.OptionList, + input.typeFunction(element.node.state) === InputTypes.List || + input.typeFunction(element.node.state) === InputTypes.OptionList, ); this.clearValues(); } diff --git a/projects/workflows-creator/src/lib/classes/nodes/abstract-prompt.class.ts b/projects/workflows-creator/src/lib/classes/nodes/abstract-prompt.class.ts index ad135b9..30dda6e 100644 --- a/projects/workflows-creator/src/lib/classes/nodes/abstract-prompt.class.ts +++ b/projects/workflows-creator/src/lib/classes/nodes/abstract-prompt.class.ts @@ -107,6 +107,7 @@ export abstract class WorkflowPrompt { case InputTypes.Text: case InputTypes.Boolean: case InputTypes.Percentage: + case InputTypes.Stepper: default: if (value) { return (value as HTMLInputElement).value; @@ -169,10 +170,14 @@ export abstract class WorkflowPrompt { .utc(state.get(this.inputKey), 'YYYY-MM-DD hh:mm') .format('MMM DD, YYYY hh:mm A') : ''; + case InputTypes.IntervalDate: + case InputTypes.IntervalTime: + return state.get(this.inputKey)?.value; case InputTypes.Number: case InputTypes.Text: case InputTypes.Boolean: case InputTypes.Percentage: + case InputTypes.Stepper: default: return state.get(this.inputKey); } @@ -209,6 +214,7 @@ export abstract class WorkflowPrompt { case InputTypes.Text: case InputTypes.Boolean: case InputTypes.Percentage: + case InputTypes.Stepper: default: return state.get(this.inputKey); } diff --git a/projects/workflows-creator/src/lib/const.ts b/projects/workflows-creator/src/lib/const.ts index 4050e0f..092f4ce 100644 --- a/projects/workflows-creator/src/lib/const.ts +++ b/projects/workflows-creator/src/lib/const.ts @@ -48,4 +48,4 @@ export const typeTuppleList: Array = [ {condition: ConditionTypes.LessThan, operator: '<', value: true}, {condition: ConditionTypes.ComingIn, operator: '-', value: true}, {condition: ConditionTypes.PastBy, operator: '+', value: true}, -]; \ No newline at end of file +]; diff --git a/projects/workflows-creator/src/lib/enum.ts b/projects/workflows-creator/src/lib/enum.ts index b44c535..0e9d3da 100644 --- a/projects/workflows-creator/src/lib/enum.ts +++ b/projects/workflows-creator/src/lib/enum.ts @@ -20,8 +20,11 @@ export enum InputTypes { People = 'people', Percentage = 'percentage', Text = 'text', - OptionList = "optionList", - Item = 'Item' + OptionList = 'optionList', + Item = 'Item', + Stepper = 'Stepper', + IntervalDate = 'IntervalDate', + IntervalTime = 'IntervalTime', } /* Defining the types of conditions that can be used in the application. */ @@ -108,3 +111,12 @@ export enum LocalizedStringKeys { SelectColumnTooltip = 'selectColumnTooltip', SetLbl = 'setLbl', } + +export enum IntervalType { + Day = 'day', + Days = 'days', + Weeks = 'weeks', + Months = 'months', + Week = 'week', + Month = 'month', +} diff --git a/projects/workflows-creator/src/lib/services/bpmn/elements/gateways/gateway.element.ts b/projects/workflows-creator/src/lib/services/bpmn/elements/gateways/gateway.element.ts index 9840a38..74b653f 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/elements/gateways/gateway.element.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/elements/gateways/gateway.element.ts @@ -40,4 +40,4 @@ export class GatewayElement extends BpmnElement { getIdentifier(): string { return GatewayElement.identifier; } -} \ No newline at end of file +} diff --git a/projects/workflows-creator/src/lib/services/bpmn/elements/process/process.element.ts b/projects/workflows-creator/src/lib/services/bpmn/elements/process/process.element.ts index 9aec485..0c30ab4 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/elements/process/process.element.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/elements/process/process.element.ts @@ -36,4 +36,4 @@ export class ProcessElement extends BpmnElement { getIdentifier(): string { return ProcessElement.identifier; } -} \ No newline at end of file +} diff --git a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts index 8813cf2..df807ae 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts @@ -7,7 +7,17 @@ import { ModdleElement, RecordOfAnyType, } from '../../../../types'; -import {WorkflowElement} from '../../../../classes'; +import {State, WorkflowElement} from '../../../../classes'; + +enum WeekDaysEnum { + sunday = 1, + monday = 2, + tuesday = 3, + wednesday = 4, + thursday = 5, + friday = 6, + saturday = 7, +} @Injectable() export class CreateBasicIntervalStrategy @@ -38,9 +48,7 @@ export class CreateBasicIntervalStrategy const state = workflowNode.state; const timeCycle = this.moddle.create('bpmn:FormalExpression', { 'xsi:type': 'bpmn:tFormalExpression', - body: `R/P${state.get('timescale')}${state.get('value')}${state.get( - 'interval', - )}`, + body: this.intervalBodyPrepare(state), }); timerEventDefinition['timeCycle'] = timeCycle; @@ -53,6 +61,49 @@ export class CreateBasicIntervalStrategy }); } + private intervalBodyPrepare(state: State) { + if ( + state.get('interval') === 'M' && + state.get('toInterval') && + state.get('TimeInterval') + ) { + const val = + state.get('value') === 1 + ? '*' + : `${state.get('toInterval').month}/${state.get('value')}`; + return `0 ${state.get('TimeInterval').min} ${ + state.get('TimeInterval').hour + } ${state.get('toInterval').date} ${val} ?`; + } else if ( + state.get('interval') === 'W' && + state.get('toInterval') && + state.get('TimeInterval') + ) { + const val = state.get('value') === 1 ? '' : `/${state.get('value')}`; + let weekDays = state + .get('toInterval') + ?.ids?.map( + (day: string) => WeekDaysEnum[day as keyof typeof WeekDaysEnum], + ) + .join(','); + return `0 ${state.get('TimeInterval').min} ${ + state.get('TimeInterval').hour + } ? * ${weekDays}${val}`; + } else if (state.get('interval') === 'D' && state.get('TimeInterval')) { + const today = new Date(); + today.setHours(state.get('TimeInterval').hour); + today.setMinutes(state.get('TimeInterval').min); + let isoString = ''; + if (today.getTime() < new Date().getTime()) { + today.setDate(today.getDate() + 1); + } + isoString = today.toISOString(); + return `R/${isoString}/P${state.get('value')}${state.get('interval')}`; + } else { + return '0 0 0 ? * *'; + } + } + /** * It takes an object of attributes and a node, and returns the same object of attributes, but with * any attribute that is a state reference replaced with the value of that state diff --git a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/task-create.strategy.ts b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/task-create.strategy.ts index aef6847..b18d0f4 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/task-create.strategy.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/task-create.strategy.ts @@ -222,4 +222,4 @@ export class CreateTaskStrategy implements CreateStrategy { return [node.prev[0].element.id]; } } -} \ No newline at end of file +} diff --git a/projects/workflows-creator/src/lib/services/bpmn/strategies/link/gateway-link.strategy.ts b/projects/workflows-creator/src/lib/services/bpmn/strategies/link/gateway-link.strategy.ts index d734dee..d936798 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/strategies/link/gateway-link.strategy.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/strategies/link/gateway-link.strategy.ts @@ -432,6 +432,7 @@ export class GatewayLinkStrategy implements LinkStrategy { const valueType = node.workflowNode.state.get('valueInputType'); if (value) switch (valueType) { + case InputTypes.Stepper: case InputTypes.Text: value = `'${value}'`; break; diff --git a/projects/workflows-creator/src/lib/services/bpmn/strategies/link/or-gateway-link.strategy.ts b/projects/workflows-creator/src/lib/services/bpmn/strategies/link/or-gateway-link.strategy.ts index dd81fd3..2ed9de6 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/strategies/link/or-gateway-link.strategy.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/strategies/link/or-gateway-link.strategy.ts @@ -230,4 +230,4 @@ export class OrGatewayLinkStrategy implements LinkStrategy { return `${pair.operator}`; } } -} \ No newline at end of file +} diff --git a/projects/workflows-creator/src/lib/services/statement/events/oninterval.event.ts b/projects/workflows-creator/src/lib/services/statement/events/oninterval.event.ts index 60b3434..26fa0f1 100644 --- a/projects/workflows-creator/src/lib/services/statement/events/oninterval.event.ts +++ b/projects/workflows-creator/src/lib/services/statement/events/oninterval.event.ts @@ -2,8 +2,9 @@ import {LocalizedStringKeys, StartElementTypes} from '../../../enum'; import {RecordOfAnyType} from '../../../types'; import {BpmnEvent} from '../../../types/bpmn.types'; import {TriggerOnInterval} from '../../bpmn/elements/tasks/trigger-on-interval.task'; +import {TimeIntervalInput, ToIntervalInput} from '../inputs'; import {IntervalInput} from '../inputs/interval.input'; -import {ValueInput} from '../inputs/value.input'; +import {StepperInput} from '../inputs/stepper.input'; export class OnIntervalEvent extends BpmnEvent { groupType: string; @@ -14,7 +15,12 @@ export class OnIntervalEvent extends BpmnEvent { name = 'On Interval'; statement = 'Every '; properties = {}; - prompts = [ValueInput.identifier, IntervalInput.identifier]; + prompts = [ + StepperInput.identifier, + IntervalInput.identifier, + ToIntervalInput.identifier, + TimeIntervalInput.identifier, + ]; static identifier = 'OnIntervalEvent'; constructor( localizedStringMap: RecordOfAnyType, diff --git a/projects/workflows-creator/src/lib/services/statement/events/onvalue.event.ts b/projects/workflows-creator/src/lib/services/statement/events/onvalue.event.ts index a8458dd..f792117 100644 --- a/projects/workflows-creator/src/lib/services/statement/events/onvalue.event.ts +++ b/projects/workflows-creator/src/lib/services/statement/events/onvalue.event.ts @@ -4,7 +4,7 @@ import {BpmnEvent} from '../../../types/bpmn.types'; import {GatewayElement} from '../../bpmn/elements/gateways/gateway.element'; import {ReadColumnValue} from '../../bpmn/elements/tasks/read-column.task'; import {ConditionInput} from '../inputs/condition.input'; -import { CriteriaInput } from '../inputs/criteria.input'; +import {CriteriaInput} from '../inputs/criteria.input'; import {ValueInput} from '../inputs/value.input'; export class OnValueEvent extends BpmnEvent { diff --git a/projects/workflows-creator/src/lib/services/statement/inputs/index.ts b/projects/workflows-creator/src/lib/services/statement/inputs/index.ts index 3fdeb2c..9207aaa 100644 --- a/projects/workflows-creator/src/lib/services/statement/inputs/index.ts +++ b/projects/workflows-creator/src/lib/services/statement/inputs/index.ts @@ -7,4 +7,7 @@ export * from './value.input'; export * from './interval.input'; export * from './triggercolumn.input'; export * from './valuetype.input'; -export * from './criteria.input'; \ No newline at end of file +export * from './criteria.input'; +export * from './stepper.input'; +export * from './tointerval.input'; +export * from './timeinterval.input'; diff --git a/projects/workflows-creator/src/lib/services/statement/inputs/interval.input.ts b/projects/workflows-creator/src/lib/services/statement/inputs/interval.input.ts index dbae337..e51f618 100644 --- a/projects/workflows-creator/src/lib/services/statement/inputs/interval.input.ts +++ b/projects/workflows-creator/src/lib/services/statement/inputs/interval.input.ts @@ -3,8 +3,8 @@ import {InputTypes} from '../../../enum'; import {RecordOfAnyType} from '../../../types'; export class IntervalInput extends WorkflowPrompt { - prefix = ''; - suffix = ''; + prefix: string | {state: string} = {state: 'valuePrefix'}; + suffix: string | {state: string} = {state: 'intervalValueSuffix'}; typeFunction = () => InputTypes.List; inputKey = 'interval'; listNameField = 'text'; diff --git a/projects/workflows-creator/src/lib/services/statement/inputs/stepper.input.ts b/projects/workflows-creator/src/lib/services/statement/inputs/stepper.input.ts new file mode 100644 index 0000000..06433e9 --- /dev/null +++ b/projects/workflows-creator/src/lib/services/statement/inputs/stepper.input.ts @@ -0,0 +1,21 @@ +import {State, WorkflowPrompt} from '../../../classes'; +import {InputTypes} from '../../../enum'; +import {RecordOfAnyType} from '../../../types'; + +export class StepperInput extends WorkflowPrompt { + prefix = ''; + suffix = ''; + typeFunction = () => InputTypes.Stepper; + inputKey = 'value'; + listNameField = 'text'; + listValueField = 'value'; + placeholder = 'n'; + customPlaceholder: string | {state: string} = {state: 'stepperPlaceholder'}; + options = (state: State) => + state.get('stepperCount') as []; + static identifier = 'StepperInput'; + + getIdentifier(): string { + return StepperInput.identifier; + } +} diff --git a/projects/workflows-creator/src/lib/services/statement/inputs/timeinterval.input.ts b/projects/workflows-creator/src/lib/services/statement/inputs/timeinterval.input.ts new file mode 100644 index 0000000..b25aa25 --- /dev/null +++ b/projects/workflows-creator/src/lib/services/statement/inputs/timeinterval.input.ts @@ -0,0 +1,30 @@ +import {State, WorkflowPrompt} from '../../../classes'; +import {InputTypes, IntervalType} from '../../../enum'; +import {BpmnNode, RecordOfAnyType} from '../../../types'; +export class TimeIntervalInput extends WorkflowPrompt { + prefix: string | {state: string} = {state: 'timeIntervalSuffix'}; + suffix = ''; + typeFunction = () => InputTypes.IntervalTime; + inputKey = 'TimeInterval'; + listNameField = 'text'; + listValueField = 'value'; + placeholder = 'hh:mm'; + customPlaceholder: string | {state: string} = {state: 'timeStatePlaceholder'}; + isHidden = (node: BpmnNode) => { + return ![ + IntervalType.Weeks, + IntervalType.Months, + IntervalType.Week, + IntervalType.Month, + IntervalType.Days, + IntervalType.Day, + ].includes(node.state.get('intervalType')); + }; + options = (state: State) => + state.get('timevalues'); + static identifier = 'TimeIntervalInput'; + + getIdentifier(): string { + return TimeIntervalInput.identifier; + } +} diff --git a/projects/workflows-creator/src/lib/services/statement/inputs/tointerval.input.ts b/projects/workflows-creator/src/lib/services/statement/inputs/tointerval.input.ts new file mode 100644 index 0000000..fcf6c88 --- /dev/null +++ b/projects/workflows-creator/src/lib/services/statement/inputs/tointerval.input.ts @@ -0,0 +1,30 @@ +import {State, WorkflowPrompt} from '../../../classes'; +import {InputTypes, IntervalType} from '../../../enum'; +import {BpmnNode, RecordOfAnyType} from '../../../types'; + +export class ToIntervalInput extends WorkflowPrompt { + prefix = ''; + suffix = ''; + typeFunction = (state: State) => + state.get('valueInputTypes') as InputTypes; + inputKey = 'toInterval'; + listNameField = 'text'; + listValueField = 'value'; + placeholder = 'weekday'; + customPlaceholder: string | {state: string} = {state: 'dateStatePlaceholder'}; + isHidden = (node: BpmnNode) => { + return ![ + IntervalType.Weeks, + IntervalType.Months, + IntervalType.Week, + IntervalType.Month, + ].includes(node.state.get('intervalType')); + }; + options = (state: State) => + state.get('intervalOption'); + static identifier = 'ToIntervalInput'; + + getIdentifier(): string { + return ToIntervalInput.identifier; + } +} diff --git a/projects/workflows-creator/src/lib/workflow-builder.module.ts b/projects/workflows-creator/src/lib/workflow-builder.module.ts index fe0b382..f730147 100644 --- a/projects/workflows-creator/src/lib/workflow-builder.module.ts +++ b/projects/workflows-creator/src/lib/workflow-builder.module.ts @@ -89,7 +89,12 @@ import {TriggerColumnInput} from './services/statement/inputs/triggercolumn.inpu import {ValueTypeInput} from './services/statement/inputs/valuetype.input'; import {TooltipRenderComponent} from './builder/tooltip-render/tooltip-render.component'; import {LocalizationPipe} from './pipes/localization.pipe'; -import { CriteriaInput } from './services'; +import { + CriteriaInput, + StepperInput, + TimeIntervalInput, + ToIntervalInput, +} from './services'; @NgModule({ declarations: [ BuilderComponent, @@ -145,7 +150,10 @@ import { CriteriaInput } from './services'; {provide: BPMN_ELEMENTS, useClass: ProcessPropertiesElement, multi: true}, {provide: BPMN_INPUTS, useClass: ColumnInput, multi: true}, {provide: BPMN_INPUTS, useClass: CriteriaInput, multi: true}, + {provide: BPMN_INPUTS, useClass: StepperInput, multi: true}, + {provide: BPMN_INPUTS, useClass: TimeIntervalInput, multi: true}, {provide: BPMN_INPUTS, useClass: TriggerColumnInput, multi: true}, + {provide: BPMN_INPUTS, useClass: ToIntervalInput, multi: true}, {provide: BPMN_INPUTS, useClass: IntervalInput, multi: true}, {provide: BPMN_INPUTS, useClass: ConditionInput, multi: true}, {provide: BPMN_INPUTS, useClass: EmailDataInput, multi: true}, From d7b49d3672118d090b7f6ac4c38e8ce6ed19f55f Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Tue, 7 Jan 2025 00:01:17 +0530 Subject: [PATCH 2/2] refactor(core): add changes --- .../create/basic-interval-create.strategy.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts index df807ae..61da4f7 100644 --- a/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts +++ b/projects/workflows-creator/src/lib/services/bpmn/strategies/create/basic-interval-create.strategy.ts @@ -68,27 +68,31 @@ export class CreateBasicIntervalStrategy state.get('TimeInterval') ) { const val = - state.get('value') === 1 + state.get('value') == 1 ? '*' : `${state.get('toInterval').month}/${state.get('value')}`; - return `0 ${state.get('TimeInterval').min} ${ - state.get('TimeInterval').hour - } ${state.get('toInterval').date} ${val} ?`; + const timeZoneDate = new Date(); + timeZoneDate.setHours(state.get('TimeInterval').hour); + timeZoneDate.setMinutes(state.get('TimeInterval').min); + return `0 timeZoneDate(${timeZoneDate})timeZoneDateEnd ${ + state.get('toInterval').date + } ${val} ?`; } else if ( state.get('interval') === 'W' && state.get('toInterval') && state.get('TimeInterval') ) { - const val = state.get('value') === 1 ? '' : `/${state.get('value')}`; + const val = state.get('value') == 1 ? '' : `/${state.get('value')}`; let weekDays = state .get('toInterval') ?.ids?.map( (day: string) => WeekDaysEnum[day as keyof typeof WeekDaysEnum], ) .join(','); - return `0 ${state.get('TimeInterval').min} ${ - state.get('TimeInterval').hour - } ? * ${weekDays}${val}`; + const timeZoneDate = new Date(); + timeZoneDate.setHours(state.get('TimeInterval').hour); + timeZoneDate.setMinutes(state.get('TimeInterval').min); + return `0 timeZoneDate(${timeZoneDate})timeZoneDateEnd ? * ${weekDays}${val}`; } else if (state.get('interval') === 'D' && state.get('TimeInterval')) { const today = new Date(); today.setHours(state.get('TimeInterval').hour);