Utils for doing data calculations based on timeUomIds
----------------------------------------------------- Key: OFBIZ-715 URL: https://issues.apache.org/jira/browse/OFBIZ-715 Project: OFBiz (The Open for Business Project) Issue Type: Improvement Components: framework Reporter: Andrew Sykes Priority: Minor Attachments: UtilDateTime.java.patch 6 new methods, 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Sykes updated OFBIZ-715: ------------------------------- Attachment: UtilDateTime.java.patch > Utils for doing data calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Sykes updated OFBIZ-715: ------------------------------- Summary: Utils for doing date calculations based on timeUomIds (was: Utils for doing data calculations based on timeUomIds) > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480779 ] Andrew Sykes commented on OFBIZ-715: ------------------------------------ Has anyone reviewed this yet? I promise it's useful ;-) > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480810 ] Jacques Le Roux commented on OFBIZ-715: --------------------------------------- I will today, I promise ;o) > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux updated OFBIZ-715: ---------------------------------- Attachment: UtilDateTime.java.patch I did not test this patch (only compiled after some formatting stuffes) but is sounds fine to me. I reviewed and slightly reformatted it. I also added TF_century and TF_millenium even if I'm not sure they will be useful... Hope a core commiter will have some time to commit it now... Thanks Andrew. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507481 ] Adrian Crum commented on OFBIZ-715: ----------------------------------- Andrew, The latest version of UtilDateTime.java has an adjustTimestamp method that achieves most of what you have in this patch. I'm curious - why is it necessary to specify the adjustment type as a String data type? That seems to add an unnecessary level of complication to the methods in your patch. As far as the elasped time computations are concerned, I like the fact that you didn't attempt to perform millisecond arithmetic. However, looping through dates until a match is found seems kind of clunky. I would like to see an accurate elasped time method added to UtilDateTime - maybe we can put our heads together and come up with a different solution. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507532 ] Adrian Crum commented on OFBIZ-715: ----------------------------------- After scouring the 'net for some ideas, I discovered that the algorithms that produce the most accurate results utilize some looping like Andrew's implementation has. The main flaw with the implementation in the attached patch is the lack of "smarts" to prevent it from excessive looping. For instance, what if you requested elapsed milliseconds since 10 years ago? The method in this patch would execute a loop for every millisecond in a ten year span. I think I've come up with a good strategy for calculating elapsed time that combines some looping with additional logic. I'll work on it this weekend and then I will submit a patch. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507550 ] David E. Jones commented on OFBIZ-715: -------------------------------------- Sounds like fun... > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534682 ] Jacques Le Roux commented on OFBIZ-715: --------------------------------------- No takers ? > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-715: ------------------------------ Attachment: elapsed_time.patch Jacques, elapsed_time.patch is the solution I came up with. Take a look at it. I worked on this code back in July. As far as I know, it works accurately except when the ending date is Feb 29 and the beginning date is Feb 28. The result should be one year. Incrementing the ending date one day (March 1) should result in 1 year + 1 day. The current version returns one year for both ending dates. I ran out of time trying to come up with a fix. If anyone wants to continue developing it they are welcome to do so. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554219 ] Jacopo Cappellato commented on OFBIZ-715: ----------------------------------------- What is the current status of this issue? > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554257 ] Adrian Crum commented on OFBIZ-715: ----------------------------------- Jacopo, The patch I attached needs to be tested and maybe fixed for the bug I mentioned. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reassigned OFBIZ-715: ------------------------------------- Assignee: Jacques Le Roux > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558939#action_12558939 ] Jacques Le Roux commented on OFBIZ-715: --------------------------------------- Hi Adrian, I did a quick review. DO you think that adding a bloc if (calStart.getTimeInMillis() >= targetMillis) { return; } before // compute elapsed years int targetYear = calEnd.get(Calendar.YEAR); while (calStart.get(Calendar.YEAR) != targetYear && calStart.getTimeInMillis() < targetMillis) { calStart.add(Calendar.YEAR, 1); years++; } could solve this issue ? I did not think much about it, it's just that it's present in other cases. BTW how do you test it, have you an existing mean for that ? Thanks > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559133#action_12559133 ] Adrian Crum commented on OFBIZ-715: ----------------------------------- Jacques, Thank you for taking a look at this! The if code block wouldn't make any difference because the while statement performs the same check. I tested it by modifying an existing date-range data entry screen. I entered a beginning and ending date, then called a method to compute the elapsed time. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562771#action_12562771 ] Jacques Le Roux commented on OFBIZ-715: --------------------------------------- Adrian, I have tested ElapsedTime and the problem is not only related to leap years. The problem arises as soon you ask for the same month with a lesser day in another year. For instance if you ask for begin : 2008-03-03 end : 2009-03-01 you get : 1 year and 29 days which is obviously false. I did not find other issues so far. So I think you should not only test if the month is the same but also if the year is the same. I began to try with if (calStart.get(Calendar.MONTH) == targetMonth && calStart.get(Calendar.YEAR) == targetYear) { but other problems arises (negative months and anyway the number of days is still false) and I quickly gave up. I suppose you had a look at http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-time.html?page=2. I found also http://www.developpez.net/forums/archive/index.php/t-207340.html (look at bottom, it's a derivative work of previous). Your algorithm seems smart and I will give it another try if you don't beat me at it... (Like David said "Sounds like fun..." ;o) > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562780#action_12562780 ] Adrian Crum commented on OFBIZ-715: ----------------------------------- Jacques, The first link performs millisecond arithmetic - a definite no-no. The second link looks more like the code I came up with, but it still falls short of giving the exact elapsed time. Instead it gives units elapsed, where units can be seconds, minutes, hours, days, etc. My objective was to create a class that, given two Calendars, can calculate the total elapsed time and return the result as years, months, days, hours, minutes, seconds, and milliseconds. This is not an easy problem to solve. I spent several days working on the code you see and I finally gave up. > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562826#action_12562826 ] Jacques Le Roux commented on OFBIZ-715: --------------------------------------- Adrian, Thanks for your explanation. Yes, I agree that it's tough work. I think that you are not so far from a success and I'm sure we need a such functionality. So I will try to fix your solution as I recognize that it"s smart. I know it's not obvious. I did some such work some years ago when I wrote Tempo in C++, a reminder I use in my everyday work. Just a remark on the form. Following our coding conventions (http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#15413) you should not use startDOM but startDom or even better StartDayOfMonth. I made 10 years before following stricly this convention and I'm happy with it now ;o) > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583483#action_12583483 ] Valentina Sirkova commented on OFBIZ-715: ----------------------------------------- Hi, I got interested in this issue and would like to contribute on it but i need your guidance about one thing. I read a lot of stuff on the net about leap years etc and got the impression it is complicated yet intriguing matter. Here is the question: How do you define year: By standard it is 365 or 366(leap) days depending on the occurrence of Feb 29. I read in your comments that the period between Feb 28 and Feb 29(leap year) is 1 year(366 days). What is the period 28 Feb and 28 Feb(leap year) then? This is 365 days is it one year again? If yes then if we want to find the difference between 2003-02-28 and 2004-02-29; 2003-02-28 and 2004-02-28 this would yeld 1 year in both situations? regards: Valentina > Utils for doing date calculations based on timeUomIds > ----------------------------------------------------- > > Key: OFBIZ-715 > URL: https://issues.apache.org/jira/browse/OFBIZ-715 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: Andrew Sykes > Assignee: Jacques Le Roux > Priority: Minor > Attachments: elapsed_time.patch, UtilDateTime.java.patch, UtilDateTime.java.patch > > > 6 new methods, > 1/ adjustDateTime (3 methods) adjusts either a Timestamp Date or Calendar by the given timeUomId and timeUomMultiple > 2/ getTimeUomMultipleDifference (3 methods) gets the timeUomMultiple for two Timestamp Date or Calendar objects given the timeUomId. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |