cullophid / date-fp

Functional programming date manipulation library
121 stars 17 forks source link

Return 0 when get('week') #51

Closed cettoana closed 7 years ago

cettoana commented 8 years ago

Hi, thanks for this nice lib, it is very helpful for me.

I got some problem when using get('week') as following

const date = new Date(2016, 0, 1);
D.get('week', date); // 0

According to the docs and ISO-8601, Is this result should be 53 instead of 0 ? Or there are some considerations ?

Many thanks!

cullophid commented 7 years ago

Hi @cettoana Thank you very much for pointing this out. this seems to be a bug in our getWeek function https://github.com/cullophid/date-fp/blob/master/src/get.js

I am quite busy at the moment, so It might take a few days before i get to have a look at it.

If you would like to do a PR it would be much appreciated :) if so please start by adding a failing test :)

cettoana commented 7 years ago

No problem, I'll try to work on this issue and do a PR :) Thanks!

cullophid commented 7 years ago

Excellent

cullophid commented 7 years ago

ups

cullophid commented 7 years ago

Im looking forward to you joining the ranks as a contributor :)

cullophid commented 7 years ago

Fixed in version 5.0.2