Skip to content

Commit 8518f86

Browse files
committed
feat: current weekday
do not confuse with current_day_of_week, which returns an index which is offset because JS does not follow the ISO standard
1 parent 7f6d819 commit 8518f86

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/get_time.gs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
2+
list TIME_WEEKDAYS = [
3+
"Monday",
4+
"Tuesday",
5+
"Wednesday",
6+
"Thursday",
7+
"Friday",
8+
"Saturday",
9+
"Sunday"
10+
];
11+
112
%define TIME() (days_since_2000() + 10957) * 86400
213
%define TIME_NS() (days_since_2000() + 10957) * 86400e+9
314

415
%define SCRATCH_DAYS() (days_since_2000() - 2691)
516

617
%define CURRENT_MILLISECOND() (86400000 * days_since_2000() % 1000)
718
%define CURRENT_MICROSECOND() (86400000000 * days_since_2000() % 1000)
19+
20+
%define CURRENT_WEEKDAY() TIME_WEEKDAYS[(current_day_of_week() - 1) % 7]

0 commit comments

Comments
 (0)