You are here: Foswiki>Tasks Web>Item809 (07 Feb 2009, ArthurClemens)Edit Attach

Item809: CALC TIMEADD month is wrong

pencil
Priority: Enhancement
Current State: Confirmed
Released In:
Target Release: minor
Applies To: Engine
Component: SpreadSheetPlugin
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: ArthurClemens
from the code:

       $value *= 3600*24*30.42 if( $scale =~ /^mon/i );  # FIXME: exact calc
       $value *= 3600*24*365   if( $scale =~ /^year/i ); # FIXME: exact calc

-- SvenDowideit - 20 Jan 2009

Hmm. I understand and partly agree.

If I add one month to a date I expect same day of month, same time and simply the calendar month increased to the next one.

But the way the CALC works I can actually also specify 0.6 month. I can have a formular that calculates decimal numbers and add a fraction of a month.

So the exact way to implement this change needs to be carefully thought of.

Also to implement this we really need a non-default CPAN lib. We should consider including one in our own Foswiki CPAN lib. Like Date::Calc.

That also enables adding additional features like adding working days.

Changing to enhancement.

-- KennethLavrsen - 07 Feb 2009

I was thinking about DateTimePlugin, but that plugin also does not handle inc_month. Shortcoming of that plugin (and date handling in general in Perl) is that dates before 1970 are not supported. Date::Calc may be a solution, but DateTime.pm seems more featurefull.

-- ArthurClemens - 07 Feb 2009

ItemTemplate edit

Summary CALC TIMEADD month is wrong
ReportedBy SvenDowideit
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component SpreadSheetPlugin
Priority Enhancement
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease minor
ReleasedIn
Topic revision: r3 - 07 Feb 2009, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy