[
https://issues.apache.org/jira/browse/LANG-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557902#action_12557902
]
Henri Yandell commented on LANG-400:
------------------------------------
Yep - we should only add features if they enhance the existing functionality
and don't butt into any of the design 'quirks' of Java time.
I wonder if the best way is to add an overload called truncateTime(Date) that
handles your zero-out section. Seems like that would fit comfortably with the
existing API, and yet still take care of the majority of your effort.
As to renaming isSameXXX to isEqualXXX - I think we should stay as is because
the English usage of 'Same' is more applicable to the time context. The spoken
language isn't used to considering time as a numerical object as Java is, and
so there is some benefit to the current name. Given that - we shouldn't mess
with the API naming.
> Add DateUtils methods to implement before and after time-insensitive
> --------------------------------------------------------------------
>
> Key: LANG-400
> URL: https://issues.apache.org/jira/browse/LANG-400
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Reporter: Paul Benedict
> Fix For: 2.4
>
>
> The JDK contains Date.before() and Date.after() but no time-insensitive
> versions exist. I am typically in the situation where TIMESTAMP columns are
> converted into Date instances and I need to compare dates only for business
> rules.
> I propose to complement DateUtils.isSameDay:
> DateUtils.isBeforeDay
> DateUtils.isAfterDay
> My private implementations convert Date to Calendar, zero-out the time
> elements, and then compare.
> PS: I would also deprecate isSameXXX methods in 2.4 and rename it to
> isEqualXXX since sameness usually implies instance equality, rather than
> object equality.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.