aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-30 01:53:39 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-30 01:53:39 -0400
commit793717729ae46bd026eff882f7d4da819dec32e5 (patch)
treecb35ac60f2821188bf86f3864ca99ad23f95944e /environment.c
parent37780cb3234441d693dcb0f2d1d4efbd6632a0a6 (diff)
Parameterize with timezones
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/environment.c b/environment.c
index 69710b41..d5b8190c 100644
--- a/environment.c
+++ b/environment.c
@@ -265,18 +265,20 @@ env_t *new_compilation_unit(CORD libname)
// Used as a default for functions below:
{"now", "DateTime$now", "func()->DateTime"},
- {"after", "DateTime$after", "func(dt:DateTime,seconds=0.0,minutes=0.0,hours=0.0,days=0,weeks=0,months=0,years=0,local_time=yes)->DateTime"},
- {"date", "DateTime$date", "func(dt:DateTime,local_time=yes)->Text"},
- {"format", "DateTime$format", "func(dt:DateTime,format=\"%Y-%m-%dT%H:%M:%S%z\",local_time=yes)->Text"},
+ {"after", "DateTime$after", "func(dt:DateTime,seconds=0.0,minutes=0.0,hours=0.0,days=0,weeks=0,months=0,years=0,timezone=!Text)->DateTime"},
+ {"date", "DateTime$date", "func(dt:DateTime,timezone=!Text)->Text"},
+ {"format", "DateTime$format", "func(dt:DateTime,format=\"%Y-%m-%dT%H:%M:%S%z\",timezone=!Text)->Text"},
{"from_unix_timestamp", "DateTime$from_unix_timestamp", "func(timestamp:Int64)->DateTime"},
- {"get", "DateTime$get", "func(dt:DateTime,year=!&Int,month=!&Int,day=!&Int,hour=!&Int,minute=!&Int,second=!&Int,nanosecond=!&Int,weekday=!&Int, local_time=yes)"},
+ {"get", "DateTime$get", "func(dt:DateTime,year=!&Int,month=!&Int,day=!&Int,hour=!&Int,minute=!&Int,second=!&Int,nanosecond=!&Int,weekday=!&Int, timezone=!Text)"},
+ {"get_local_timezone", "DateTime$get_local_timezone", "func()->Text"},
{"hours_till", "DateTime$hours_till", "func(now:DateTime,then:DateTime)->Num"},
{"minutes_till", "DateTime$minutes_till", "func(now:DateTime,then:DateTime)->Num"},
- {"new", "DateTime$new", "func(year:Int,month:Int,day:Int,hour=0,minute=0,second=0.0)->DateTime"},
+ {"new", "DateTime$new", "func(year:Int,month:Int,day:Int,hour=0,minute=0,second=0.0,timezone=!Text)->DateTime"},
{"parse", "DateTime$parse", "func(text:Text, format=\"%Y-%m-%dT%H:%M:%S%z\")->DateTime?"},
- {"relative", "DateTime$relative", "func(dt:DateTime,relative_to=DateTime.now(),local_time=yes)->Text"},
+ {"relative", "DateTime$relative", "func(dt:DateTime,relative_to=DateTime.now(),timezone=!Text)->Text"},
{"seconds_till", "DateTime$seconds_till", "func(now:DateTime,then:DateTime)->Num"},
- {"time", "DateTime$time", "func(dt:DateTime,seconds=no,am_pm=yes,local_time=yes)->Text"},
+ {"set_local_timezone", "DateTime$set_local_timezone", "func(timezone=!Text)"},
+ {"time", "DateTime$time", "func(dt:DateTime,seconds=no,am_pm=yes,timezone=!Text)->Text"},
{"unix_timestamp", "DateTime$unix_timestamp", "func(dt:DateTime)->Int64"},
)},
{"Path", Type(TextType, .lang="Path", .env=namespace_env(env, "Path")), "Text_t", "Text$info", TypedArray(ns_entry_t,