You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After we've added date_shift, there are some more options that seem obviously useful:
date_replace(date, value, unit) -> date - replace parts of a date, e.g. set a date to the first of a month date_replace("2020-05-13", 1, "day") -> "2020-05-01"
date_get(date, unit) -> value - get a part of a date, e.g. get the year date_get("2020-05-13", "year") -> 2020 or get the day date_get("2020-05-13", "day") -> 13 (name could also be date_element in accordance to array_element? 😅)
With date_get and date_shift one could emulate date_replace to some degree, but not fully (e.g. can't do the "snap" behavior) so they have both their use cases.
The text was updated successfully, but these errors were encountered:
I just had a use case that requires this: for best available pixel compositing, one weighting score is distance to the middle of the compositing period. In the context of a callback, we have access to the time dimension label (date), but we don't necessarily know for which month we are computing a composite.
With date_replace I can do something like: abs(date_difference(label, date_replace(label, value=15,component="day")))
Seems like we can take the definitions from the PR for an initial implementation!
After we've added date_shift, there are some more options that seem obviously useful:
date_replace(date, value, unit) -> date
- replace parts of a date, e.g. set a date to the first of a monthdate_replace("2020-05-13", 1, "day") -> "2020-05-01"
date_get(date, unit) -> value
- get a part of a date, e.g. get the yeardate_get("2020-05-13", "year") -> 2020
or get the daydate_get("2020-05-13", "day") -> 13
(name could also be date_element in accordance to array_element? 😅)With date_get and date_shift one could emulate date_replace to some degree, but not fully (e.g. can't do the "snap" behavior) so they have both their use cases.
The text was updated successfully, but these errors were encountered: