From f6e33cfff56ccb2834c86707b0f45294bdf350bc Mon Sep 17 00:00:00 2001 From: Trivernis Date: Wed, 31 Jul 2019 21:22:06 +0200 Subject: [PATCH] Changes to system variables --- src/lib/globvars.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/globvars.ts b/src/lib/globvars.ts index e69de29..e5c2231 100644 --- a/src/lib/globvars.ts +++ b/src/lib/globvars.ts @@ -0,0 +1,17 @@ +let format = require("date-format"); + +const dateTimeFormat = "dd.MM.yyyy hh:mm:ss"; +const dateFormat = "dd.MM.yyyy"; +const timeFormat = "hh:mm:ss"; + +export const globalVariables: any = { + "\\$now"() { + return format(dateTimeFormat, new Date()); + }, + "\\$date"() { + return format(dateFormat, new Date()); + }, + "\\$time"() { + return format(timeFormat, new Date()); + } +};