Skip to content

Commit

Permalink
fix: fix date expression
Browse files Browse the repository at this point in the history
  • Loading branch information
adyfk committed Dec 16, 2023
1 parent 17d899d commit fb5845f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export function createParser(props: ExpressionParserConstructor = {}) {
date_in_format: (_, format: string, date: string) => date ? moment(date, format).toISOString() : moment().toISOString(),
date_in_millis: (_, date: number) => moment(date).toISOString(),
date_millis: (_, date: string) => date ? moment(date).valueOf() : moment().valueOf(),
date_plus: (_, amount: number, unit: Unit, date: string) => date ? moment(date).add(amount, unit) : moment().add(amount, unit),
date_minus: (_, amount: number, unit: Unit, date: string) => date ? moment(date).subtract(amount, unit) : moment().subtract(amount, unit),
date_plus: (_, amount: number, unit: Unit, date: string) => date ? moment(date).add(amount, unit).toISOString() : moment().add(amount, unit).toISOString(),
date_minus: (_, amount: number, unit: Unit, date: string) => date ? moment(date).subtract(amount, unit).toISOString() : moment().subtract(amount, unit).toISOString(),

// CONDITION ==================================================================================
if: (_, condition: boolean, truthy: any, falsy) => {
Expand Down

0 comments on commit fb5845f

Please sign in to comment.