Skip to content

To the End of the Month #182

@eric1234

Description

@eric1234

I can do a date that includes the end of the month:

> puts *Montrose.daily(mday: [25, -1]).take(10)
2025-03-31 17:14:27 -0400
2025-04-25 17:14:27 -0400
2025-04-30 17:14:27 -0400
2025-05-25 17:14:27 -0400
2025-05-31 17:14:27 -0400
2025-06-25 17:14:27 -0400
2025-06-30 17:14:27 -0400
2025-07-25 17:14:27 -0400
2025-07-31 17:14:27 -0400
2025-08-25 17:14:27 -0400

I can also do a range of date:

> puts *Montrose.daily(mday: 25..27).take(10)
2025-03-27 17:14:56 -0400
2025-04-25 17:14:56 -0400
2025-04-26 17:14:56 -0400
2025-04-27 17:14:56 -0400
2025-05-25 17:14:56 -0400
2025-05-26 17:14:56 -0400
2025-05-27 17:14:56 -0400
2025-06-25 17:14:56 -0400
2025-06-26 17:14:56 -0400
2025-06-27 17:14:56 -0400

But I cannot do a range until the end of the month:

> puts *Montrose.daily(mday: 25..-1).take(10)
2025-03-27 17:15:28 -0400
2025-03-28 17:15:28 -0400
2025-03-29 17:15:28 -0400
2025-03-30 17:15:28 -0400
2025-03-31 17:15:28 -0400
2025-04-01 17:15:28 -0400
2025-04-02 17:15:28 -0400
2025-04-03 17:15:28 -0400
2025-04-04 17:15:28 -0400
2025-04-05 17:15:28 -0400

It seems to start at the right place but then doesn't end correctly and start again at the right place next month.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions