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

Leap year support in dayOfYear() #8

Closed
ryanblock opened this issue Apr 24, 2017 · 3 comments
Closed

Leap year support in dayOfYear() #8

ryanblock opened this issue Apr 24, 2017 · 3 comments
Labels

Comments

@ryanblock
Copy link
Contributor

👇

for(let i = 0; i < 15; i++) {
  var s = spacetime({
    year: 2014 + i
  }).endOf('year');
  console.log(s.dayOfYear());
}
spencermountain added a commit that referenced this issue Nov 17, 2017
@spencermountain
Copy link
Owner

hey @ryanblock , that's clever - is this right?

2014 366
2015 366
2016 367
2017 366
2018 366
2019 366
2020 367
2021 366
2022 366
2023 366
2024 367
2025 366
2026 366
2027 366
2028 367

... because the jan 1st is 1st... the last day is 366th...?

@ryanblock
Copy link
Contributor Author

Last time I checked, regular years have 365, not 366 days (and leap years +1 day).

spencermountain added a commit that referenced this issue Nov 17, 2017
@spencermountain
Copy link
Owner

got it in v2.1.1 check it out~
thanks!

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

No branches or pull requests

2 participants