Commit b7ff26c8 authored by Ferhat Mihoubi's avatar Ferhat Mihoubi Committed by Stéphane Adjemian
Browse files

Correct the way to handle the frequencies when a number of periods is added to a dynDate

parent a190f3f7
...@@ -67,10 +67,10 @@ switch a.freq ...@@ -67,10 +67,10 @@ switch a.freq
c.time(1) = a.time(1) + b - 1; c.time(1) = a.time(1) + b - 1;
case {4,12,52} case {4,12,52}
c = a; c = a;
n1 = b; n1 = b + a.time(2);
n2 = floor(n1/a.freq); n2 = floor((n1 - 1)/a.freq);
n3 = mod(n1,a.freq); n3 = mod(n1 - 1,a.freq) + 1;
c.time(2) = c.time(2)+n3-1; c.time(2) = n3;
c.time(1) = c.time(1)+n2; c.time(1) = c.time(1)+n2;
otherwise otherwise
error('dynDate::plus: Unknown frequency!') error('dynDate::plus: Unknown frequency!')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment