diff --git a/pkg/functions/functions.go b/pkg/functions/functions.go index a4550c5d..0266eb2d 100644 --- a/pkg/functions/functions.go +++ b/pkg/functions/functions.go @@ -167,7 +167,7 @@ var fmap = map[string]interface{}{ "future": Future, "past": Past, "recent": Recent, - "justpassed": Justpassed, + "just_passed": Justpassed, "now_sub": Nowsub, "now_add": Nowadd, "soon": Soon, diff --git a/pkg/functions/functionsDescription.go b/pkg/functions/functionsDescription.go index 3e56591f..15b02796 100644 --- a/pkg/functions/functionsDescription.go +++ b/pkg/functions/functionsDescription.go @@ -654,14 +654,14 @@ var funcDesc = map[string]FunctionDescription{ Example: "jr template run --embedded '{{join \"hello,\" \"world\"}}'", Output: "hello,world", }, - "justpassed": { - Name: "justpassed", + "just_passed": { + Name: "just_passed", Category: "time", Description: "returns a date in the past not before the given milliseconds", Parameters: "milliseconds int", Localizable: false, Return: "string", - Example: "jr template run --embedded '{{justpassed 60000}}'", + Example: "jr template run --embedded '{{just_passed 60000}}'", Output: "2024-11-10 22:59:5", }, "key": { @@ -884,6 +884,26 @@ var funcDesc = map[string]FunctionDescription{ Example: "jr template run --embedded '{{nearby_gps 41.9028 12.4964 1000}}'", Output: "41.8963 12.4975", }, + "now_add": { + Name: "now_add", + Category: "time", + Description: "returns a date in the future for the given milliseconds", + Parameters: "milliseconds int", + Localizable: false, + Return: "string", + Example: "jr template run --embedded '{{now_add 60000}}'", + Output: "2024-11-10 21:50:00", + }, + "now_sub": { + Name: "now_sub", + Category: "time", + Description: "returns a date in the past for the given milliseconds", + Parameters: "milliseconds int", + Localizable: false, + Return: "string", + Example: "jr template run --embedded '{{now_sub 60000}}'", + Output: "2024-11-10 22:01:00", + }, "password": { Name: "password", Category: "security",