-
Notifications
You must be signed in to change notification settings - Fork 55
DateTime getMonth() functions returning the wrong value (month - 1) #574
Comments
This is behavior inherited from momentJS... http://momentjs.com/docs/#/get-set/month/ I don't know why it is done this way in momentJS, but we could take a different road and have months ranging from 1 to 12 instead of from 0 to 11. Would welcome feedback on this from the community. |
Mmm very odd. OK no worries I will just add one to the value for now but it would be good to make Ergo at least behave consistently. |
Right. I guess I'm saying it's consistent with the (arguably inconsistent) semantics in momentjs. I will make the months range from 1 to 12 unless I hear someone object. |
I agree, moment is the inconsistent one! |
PR here: #582 |
Done in 0.7.0 |
I have a
DateTime
parameter on my request, and is being set using the UTC value2019-03-11T12:30:59.000Z
.If I call the following
DateTime
getX functions I get the following results:All of them are correct apart from the
getMonth
, so is this for some reason indexed from zero which is why the third month is the value two?The text was updated successfully, but these errors were encountered: