Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for startOf("decade") #5831

Open
lburch02 opened this issue Feb 18, 2021 · 1 comment
Open

Add support for startOf("decade") #5831

lburch02 opened this issue Feb 18, 2021 · 1 comment

Comments

@lburch02
Copy link

I find the lack of a startOf("decade") function frustrating because there is no simple way to get the date of the start of a decade.

The same way that moment().startOf("week") works and returns the first day of the week, I would like a moment().startOf("decade") which returns the first day of the decade.

@cutterbl
Copy link

If I were to extend moment (plugin), how could I define a 'decade' or a 'century' so that math would work out of the box (add, subtract, startOf, etc). It would seem that I would start with defining a Duration somehow, and I know I would have to extend my prototype to include the proper methods (decade(value?)). Just trying to wrap my head around how I would go about this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants