Verified Commit 5858f51e authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fixed bug introduced in 7bb6a68f.

parent 54114116
......@@ -74,12 +74,12 @@ function ts = dseries2M(ds, method)
end
function eld = expectedlastday(m)
if ismember(m.time(2), [4,6,9,11])
if ismember(subperiod(m), [4,6,9,11])
eld = 30;
elseif ismember(m.time(2), [1,3,5,7,8,10,12])
elseif ismember(subperiod(m), [1,3,5,7,8,10,12])
eld = 31;
else % February
if isleapyear(m.time(1))
if isleapyear(year(m))
eld = 29;
else
eld = 28;
......@@ -88,12 +88,12 @@ function eld = expectedlastday(m)
end
function iad = isalldays(m, id)
if ismember(m.time(2), [4,6,9,11])
if ismember(subperiod(m), [4,6,9,11])
iad = length(id)==30;
elseif ismember(m.time(2), [1,3,5,7,8,10,12])
elseif ismember(subperiod(m), [1,3,5,7,8,10,12])
iad = length(id)==31;
else % February
if isleapyear(m.time(1))
if isleapyear(year(m))
iad = length(id)==29;
else
iad = length(id)==28;
......
......@@ -91,7 +91,7 @@ function ts = dseries2Q(ds, method)
end
function eld = expectedlastday(q)
if ismember(q.time(2), [1,4])
if ismember(subperiod(q), [1,4])
eld = 31; % last day of March or December
else
eld = 30; % last day of June or September
......@@ -99,7 +99,7 @@ function eld = expectedlastday(q)
end
function elm = expectedlastmonth(q)
switch q.time(2)
switch subperiod(q)
case 1
elm = 3;
case 2
......@@ -113,12 +113,12 @@ function elm = expectedlastmonth(q)
end
function iad = isalldays(m, id)
if ismember(m.time(2), [3, 4])
if ismember(subperiod(m), [3, 4])
iad = length(id)==92;
elseif m.time(2)==2
elseif subperiod(m)==2
iad = length(id)==91;
else % contains February
if isleapyear(m.time(1))
if isleapyear(year(m))
iad = length(id)==91;
else
iad = length(id)==90;
......
Markdown is supported
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