Closed Isira-Seneviratne closed 1 year ago
Hi @Isira-Seneviratne - Thank you VERY MUCH for all of the work you have put into this PR. I think it is moving in the right direction, but there are some things that need to be changed. I am grateful for all of your effort and I think we can make this a great update to PrettyTime!
A few comments to summarize the review above:
*
. Please retain the order of import statements.ResourcesChronoUnit
should be refactored into a static utility. TimeUnit
exists for the reason that it is intentionally more flexible than what an enum
can provide. The java.time.temporal.ChronoUnit
type should simply be added as a configuration option in org.ocpsoft.prettytime.PrettyTime
configuration methods.ResourcesChronoUnit
in a lot of internal places. Those will need to be reverted to use TimeUnit
. We can discuss additional API changes to reduce dependency on the actual Java Class implementations of TimeUnit
in a separate PR!Again, thank you so much for this. Please review my comments on the PR (in the review), and I look forward to getting this into the library!
Hi @Isira-Seneviratne - Thank you VERY MUCH for all of the work you have put into this PR. I think it is moving in the right direction, but there are some things that need to be changed. I am grateful for all of your effort and I think we can make this a great update to PrettyTime!
A few comments to summarize the review above:
- Please use individual imports instead of wildcards
*
. Please retain the order of import statements.ResourcesChronoUnit
should be refactored into a static utility.TimeUnit
exists for the reason that it is intentionally more flexible than what anenum
can provide. Thejava.time.temporal.ChronoUnit
type should simply be added as a configuration option inorg.ocpsoft.prettytime.PrettyTime
configuration methods.- Most of the changes in the Java Resource translation bundles can be reverted. There are some that I agree with, however. Please see my comments there.
- Some test cases were deleted. Could you explain why?
Due to using the new enum I added, those tests were failing. That shouldn't be an issue since I'll be updating the changes based on your comments, so I'll restore the tests.
- You've used
ResourcesChronoUnit
in a lot of internal places. Those will need to be reverted to useTimeUnit
. We can discuss additional API changes to reduce dependency on the actual Java Class implementations ofTimeUnit
in a separate PR!Again, thank you so much for this. Please review my comments on the PR (in the review), and I look forward to getting this into the library!
Of course.
Sorry for the delay @Isira-Seneviratne - The holidays here are a busy time! I will get this reviewed again and hopefully merge ASAP!
Apologies again for the delay. I am putting this on my list to complete this week.
Refactors the code to make use of
java.time
'sChronoUnit
enum. (Issue #247)