You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Requirement module and a requirement in it. Right click the Requirement -> Show Reflective editor and change the created at field as 1452928596359 . (Which is Jan 16 , 2016) . Press F5. The difference is shown as (71 months ago) while the actual difference is only 26 months.
On first level analysis, it is seen that TimeHelper.asReadableDeltaString() method's final return statement is return (delta / (MONTHS * WEEKS * DAYS * HOURS * MINUTES * SECONDS)) + " months ago";
There is no need for WEEKS in the above statement, because the field MONTHS is defined in terms of days and not weeks. private static final int MONTHS = 30;
P.S : The expression in denominator is full of int s, the result of denominator might cross the limit of int type, which also might result in incorrect value.
The text was updated successfully, but these errors were encountered:
Create a Requirement module and a requirement in it. Right click the Requirement -> Show Reflective editor and change the created at field as 1452928596359 . (Which is Jan 16 , 2016) . Press F5. The difference is shown as (71 months ago) while the actual difference is only 26 months.
On first level analysis, it is seen that TimeHelper.asReadableDeltaString() method's final return statement is
return (delta / (MONTHS * WEEKS * DAYS * HOURS * MINUTES * SECONDS)) + " months ago";
There is no need for WEEKS in the above statement, because the field MONTHS is defined in terms of days and not weeks.
private static final int MONTHS = 30;
P.S : The expression in denominator is full of int s, the result of denominator might cross the limit of int type, which also might result in incorrect value.
The text was updated successfully, but these errors were encountered: