Skip to content

Months can be off by one #4

@joneshf

Description

@joneshf

It looks like this line:

return moment(Date.parse(date)).format('MM/YYYY')

sometimes makes the months be off by one. E.g. if the "startDate" is "2020-10", the generated date will be 09/2020. Or if the "startDate" is "2020-10-01", the generated date will be 09/2020

It looks like things would work out if moment was used directly:

> moment(Date.parse("2020-10")).format("MM/YYYY")
"09/2020"
> moment("2020-10").format("MM/YYYY")
"10/2020"
> moment(Date.parse("2020-10-01")).format("MM/YYYY")
"09/2020"
> moment("2020-10-01").format("MM/YYYY")
"10/2020"

Though, I'm not sure if that causes other problems. Thoughts?

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