Skip to content

Commit

Permalink
Resolved #6547 - Add various utility date related expression function…
Browse files Browse the repository at this point in the history
…s - added u-test cases
  • Loading branch information
tsv2013 committed Jul 28, 2023
1 parent bf10331 commit 6cdb659
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/expressions/expressionParserTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1442,4 +1442,12 @@ QUnit.test("year, month, day, weekday", function(assert) {
assert.deepEqual(runner.run({}), 28, "day");
runner = new ExpressionRunner("weekday('2023-07-28')");
assert.deepEqual(runner.run({}), 5, "weekday");
runner = new ExpressionRunner("year()");
assert.deepEqual(runner.run({}), new Date().getFullYear(), "current year");
runner = new ExpressionRunner("month()");
assert.deepEqual(runner.run({}), new Date().getMonth() + 1, "current month");
runner = new ExpressionRunner("day()");
assert.deepEqual(runner.run({}), new Date().getDate(), "current day");
runner = new ExpressionRunner("weekday()");
assert.deepEqual(runner.run({}), new Date().getDay(), "current weekday");
});

0 comments on commit 6cdb659

Please sign in to comment.