choptastic / qdate

Erlang date, time, and timezone management: formatting, conversion, and date arithmetic
http://sigma-star.com/blog/post/qdate
MIT License
246 stars 82 forks source link

beginning_minute seems wrong. #23

Closed silviucpp closed 8 years ago

silviucpp commented 8 years ago

beginningminute(Date) -> {{Y,M,D},{H,M,}} = to_date(Date), {{Y,M,D},{H,M,0}}.

Based on the code first line will match only in case Minute is equal with Month. Otherwise will fail...

M is used for both

Silviu

choptastic commented 8 years ago

Thanks! You're right! I'll fix this shortly.

-Jesse

Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Apr 20, 2016 11:00 AM, "Silviu Caragea" notifications@github.com wrote:

beginningminute(Date) -> {{Y,M,D},{H,M,}} = to_date(Date), {{Y,M,D},{H,M,0}}.

Based on the code first line will match only in case Minute is equal with Month. Otherwise will fail...

M is used for both

Silviu

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/choptastic/qdate/issues/23

choptastic commented 8 years ago

Fixed with https://github.com/choptastic/qdate/commit/4d42f5eddf7f33d915946d3dca718845c2285c57

Thanks again for pointing it out. I need to add some tests for these new functions.