Problem
When a date range has an exclusive end, displaying the period requires showing the end as the previous day. For example, a period filter from 2020-01-01 to 2021-01-01 should display as "Jan 2020 - Dec 2020" -- the end (2021-01-01) shown as Dec 2020.
There is currently no formatter that can render a date shifted by a day.
Possible directions
-
daybefore formatter -- behaves exactly like datetime (same format pattern argument), but renders the date minus one day. E.g. daybefore;MMM yyyy -> 2021-01-01 renders as Dec 2020.
-
dateOffset formatter -- a more general, chainable formatter that shifts a date by an arbitrary unit/amount before a date formatter is applied. E.g. dateOffset;day;-1:datetime;MMM yyyy. More flexible (months/years, positive/negative), at the cost of an extra step.
Problem
When a date range has an exclusive end, displaying the period requires showing the end as the previous day. For example, a period filter from
2020-01-01to2021-01-01should display as "Jan 2020 - Dec 2020" -- the end (2021-01-01) shown asDec 2020.There is currently no formatter that can render a date shifted by a day.
Possible directions
daybeforeformatter -- behaves exactly likedatetime(same format pattern argument), but renders the date minus one day. E.g.daybefore;MMM yyyy->2021-01-01renders asDec 2020.dateOffsetformatter -- a more general, chainable formatter that shifts a date by an arbitrary unit/amount before a date formatter is applied. E.g.dateOffset;day;-1:datetime;MMM yyyy. More flexible (months/years, positive/negative), at the cost of an extra step.