Skip to content

ceiling_date behavior should fit the intuition at boundary #390

@shrektan

Description

@shrektan

Issue Description

As discussed in #262, the ceiling_date behaves strangely at the boundary (i.e., the first date of a month or a quarter), as documented in ceiling_date,

By convention the boundary for a month is the first second of the month. Thus floor_date(ymd("2000-03-01"), "month") gives "2000-03-01 UTC".

Current behavior

lubridate::ceiling_date(as.Date("2016-03-01"), unit = "month")
# [1] "2016-03-01"
lubridate::ceiling_date(as.Date("2016-03-02"), unit = "month")
# [1] "2016-04-01"

What users might expect

However, the users (at least myself) would naturally expect the two lines above return the same value 2016-04-01.

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions