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 milliseconds #19

Merged
merged 7 commits into from Nov 17, 2019

Conversation

debona
Copy link
Contributor

@debona debona commented Oct 21, 2017

Hi there!

Java Date are precise to milliseconds so I think it would be a good idea for this library to support milliseconds.

Otherwise, you don't have any way of creating two equal dates:

val date     = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minute = 58, second = 31)
val sameDate = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minute = 58, second = 31)
date.equals(sameDate) // => return false!

This PR allow this library to creates two equal dates:

val date     = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minute = 58, second = 31, millisecond = 777)
val sameDate = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minute = 58, second = 31, millisecond = 777)
date.equals(sameDate) // => return true

I think there is no breaking changes and all unit tests should pass.
Don't hesitate to ask me for changes, I really like this library but I need to compare dates equality so I need this changes :)

@debona
Copy link
Contributor Author

debona commented Oct 21, 2017

It seems this changes are awaited for few months: #18 #11

@ashishkrishnan
Copy link

ashishkrishnan commented Nov 21, 2017

@hotchemi My team and I hit a blocker when we tried using khronos with Mockito for tests.
The time in production code and the tests differed by few millis, which in turn caused Mockito to return NPE on unmatched fields.

Interesting to note, adding a millis support fixed it.
I think it is good to go for merging!.

Library is rad!! Kudos!

@debona Thanks, you saved us a day.

@debona
Copy link
Contributor Author

debona commented Nov 21, 2017

Hey @ashishkrishnan I'm glad to hear it helps other people 👍
@hotchemi any news? This library took a good start, do you plan to maintain it?

@hotchemi
Copy link
Owner

Oh sorry let me check!

@ashishkrishnan
Copy link

ashishkrishnan commented Jan 25, 2018

@hotchemi @debona any update on this?

@LeoColman
Copy link

I believe this lib is dead. Milliseconds is a very necessary feature!

@urgentx urgentx merged commit cbeb9f7 into hotchemi:master Nov 17, 2019
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

Successfully merging this pull request may close these issues.

None yet

5 participants