Index: src/macros.py |
diff --git a/src/macros.py b/src/macros.py |
index 70d8f120c574ece4f3f09bef7bd7aa35556b246b..8d836aae5bc3f3b3ffd06bd4ef03e9daa121b174 100644 |
--- a/src/macros.py |
+++ b/src/macros.py |
@@ -164,22 +164,26 @@ const MAX_TIME_BEFORE_UTC = 8640002592000000; |
# Gets the value of a Date object. If arg is not a Date object |
# a type error is thrown. |
+macro DATE_VALUE_UNCHECKED(arg) = (%_DateField(arg, 0)); |
+macro DATE_LOCAL_UNCHECKED(arg) = (%_DateField(arg, 1)); |
macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 0) : ThrowDateTypeError()); |
-macro DATE_YEAR(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 1) : ThrowDateTypeError()); |
-macro DATE_MONTH(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 2) : ThrowDateTypeError()); |
-macro DATE_DAY(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 3) : ThrowDateTypeError()); |
-macro DATE_HOUR(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 4) : ThrowDateTypeError()); |
-macro DATE_MIN(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 5) : ThrowDateTypeError()); |
-macro DATE_SEC(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 6) : ThrowDateTypeError()); |
-macro DATE_MS(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 7) : ThrowDateTypeError()); |
+macro DATE_LOCAL(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 1) : ThrowDateTypeError()); |
+macro DATE_YEAR(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 2) : ThrowDateTypeError()); |
+macro DATE_MONTH(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 3) : ThrowDateTypeError()); |
+macro DATE_DAY(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 4) : ThrowDateTypeError()); |
+macro DATE_HOUR(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 5) : ThrowDateTypeError()); |
+macro DATE_MIN(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 6) : ThrowDateTypeError()); |
+macro DATE_SEC(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 7) : ThrowDateTypeError()); |
+macro DATE_WEEKDAY(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, 8) : ThrowDateTypeError()); |
macro SET_DATE_VALUE(arg, value) = (%_SetDateField(arg, 0, value)); |
-macro SET_DATE_YEAR(arg, value) = (%_SetDateField(arg, 1, value)); |
-macro SET_DATE_MONTH(arg, value) = (%_SetDateField(arg, 2, value)); |
-macro SET_DATE_DAY(arg, value) = (%_SetDateField(arg, 3, value)); |
-macro SET_DATE_HOUR(arg, value) = (%_SetDateField(arg, 4, value)); |
-macro SET_DATE_MIN(arg, value) = (%_SetDateField(arg, 5, value)); |
-macro SET_DATE_SEC(arg, value) = (%_SetDateField(arg, 6, value)); |
-macro SET_DATE_MS(arg, value) = (%_SetDateField(arg, 7, value)); |
+macro SET_DATE_LOCAL(arg, value) = (%_SetDateField(arg, 1, value)); |
+macro SET_DATE_YEAR(arg, value) = (%_SetDateField(arg, 2, value)); |
+macro SET_DATE_MONTH(arg, value) = (%_SetDateField(arg, 3, value)); |
+macro SET_DATE_DAY(arg, value) = (%_SetDateField(arg, 4, value)); |
+macro SET_DATE_HOUR(arg, value) = (%_SetDateField(arg, 5, value)); |
+macro SET_DATE_MIN(arg, value) = (%_SetDateField(arg, 6, value)); |
+macro SET_DATE_SEC(arg, value) = (%_SetDateField(arg, 7, value)); |
+macro SET_DATE_WEEKDAY(arg, value) = (%_SetDateField(arg, 8, value)); |
macro DAY(time) = ($floor(time / 86400000)); |
macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DateFromTime(time)); |
macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24)); |