Skip to content

Add a daybefore formatter (date minus one day) #1290

@mstijak

Description

@mstijak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions