From 13b50cf84170edb02a5e1d07299378d9e56ba8e7 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 8 Nov 2020 17:02:02 +0100 Subject: [PATCH] Add dateSet and dateGet functions --- editor/src/formula.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/src/formula.js b/editor/src/formula.js index 897dcbf..8b87a51 100644 --- a/editor/src/formula.js +++ b/editor/src/formula.js @@ -28,6 +28,14 @@ function dateAdd(d, n, s) { return date(d).add(n, s) } +function dateSet(d, n, s) { + return date(d).set(s, n) +} + +function dateGet(d, s) { + return date(d).get(s) +} + function dateFormat(d, fmt) { return date(d).format(fmt) } @@ -63,6 +71,8 @@ function dateDiff(a, b, g) { export default { date, dateAdd, + dateSet, + dateGet, dateFormat, dateStartOf, dateEndOf,