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()); + } +};