Index: src/macros.py |
diff --git a/src/macros.py b/src/macros.py |
index 32c965140b58d1f6e188bd15c9a4624a397d3730..b0f3e1ed3ddc0150076abd60ced4e2381c83319f 100644 |
--- a/src/macros.py |
+++ b/src/macros.py |
@@ -146,11 +146,15 @@ macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateT |
macro DAY(time) = ($floor(time / 86400000)); |
macro MONTH_FROM_TIME(time) = (MonthFromTime(time)); |
macro DATE_FROM_TIME(time) = (DateFromTime(time)); |
+macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DATE_FROM_TIME(time)); |
macro YEAR_FROM_TIME(time) = (YearFromTime(time)); |
macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24)); |
macro MIN_FROM_TIME(time) = (Modulo($floor(time / 60000), 60)); |
+macro NAN_OR_MIN_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : MIN_FROM_TIME(time)); |
macro SEC_FROM_TIME(time) = (Modulo($floor(time / 1000), 60)); |
+macro NAN_OR_SEC_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : SEC_FROM_TIME(time)); |
macro MS_FROM_TIME(time) = (Modulo(time, 1000)); |
+macro NAN_OR_MS_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time: (Modulo(time, 1000))); |
Vyacheslav Egorov (Chromium)
2010/07/05 14:52:18
define in terms of MS_FROM_TIME?
whitespace befor
|
# Last input and last subject of regexp matches. |
macro LAST_SUBJECT(array) = ((array)[1]); |