Hi, There is an issue with calworkseconds, every time if start second

Hi,

There is an issue with calworkseconds, every time if start seconds are greater than end seconds, calculates wrong value e.g.

Starttime : 2015-08-27 19:30:50.00
Endtime : 2015-08-27 19:31:01.00

Difference should be 11 secs but it calculate 71 secs

As i could see the code, with

secondOffset = startSeconds > endSeconds ? 60 - startSeconds + endSeconds : endSeconds - startSeconds;

above code implies 50 > 01 so 60 - 50 + 01 = 11

and then (aCal.workingMinutesInRange(19:30, 19:31) * 60) = 60

and then

return (long)(aCal.workingMinutesInRange(startCalendar, endCalendar) * 60) + secondOffset;

return 60 + 11 = 71

So, if workingMinutesInRange is one and secondOffset is less then 60 it should not add additional 60 secs i.e. workingMinutesInRange.

Any help to fix this bug in plugin!

Thanks

OriginalPostID-164215

OriginalPostID-164215

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data