Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DateMath: Fix semantics of rounding with inclusive/exclusive ranges.
Date math rounding currently works by rounding the date up or down based on the scope of the rounding. For example, if you have the date `2009-12-24||/d` it will round down to the inclusive lower end `2009-12-24T00:00:00.000` and round up to the non-inclusive date `2009-12-25T00:00:00.000`. The range endpoint semantics work as follows: * `gt` - round D down, and use > that value * `gte` - round D down, and use >= that value * `lt` - round D down, and use < * `lte` - round D up, and use <= There are 2 problems with these semantics: * `lte` ends up including the upper value, which should be non-inclusive * `gt` only excludes the beginning of the date, not the entire rounding scope This change makes the range endpoint semantics symmetrical. First, it changes the parser to round up and down using the first (same as before) and last (1 ms less than before) values of the rounding scope. This makes both rounded endpoints inclusive. The range endpoint semantics are then as follows: * `gt` - round D up, and use > that value * `gte` - round D down, and use >= that value * `lt` - round D down, and use < that value * `lte` - round D up, and use <= that value closes #8424 closes #8556
- Loading branch information
Showing
6 changed files
with
271 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.