Skip to content
Snippets Groups Projects
Commit 18e68049 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

fix typo in isquarterly. closes #10

parent 68483930
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ if isyearly(a) ...@@ -30,7 +30,7 @@ if isyearly(a)
return return
end end
if isquaterly(a) if isquarterly(a)
year = 1:(regexp(a,'[Qq]')-1); year = 1:(regexp(a,'[Qq]')-1);
date.freq = 4; date.freq = 4;
date.time = write_time_field(a, year); date.time = write_time_field(a, year);
......
function b = isquaterly(str) % --*-- Unitary tests --*-- function b = isquarterly(str) % --*-- Unitary tests --*--
% Tests if the input can be interpreted as a quaterly date. % Tests if the input can be interpreted as a quarterly date.
% %
% INPUTS % INPUTS
% o str string. % o str string.
% %
% OUTPUTS % OUTPUTS
% o b integer scalar, equal to 1 if str can be interpreted as a quaterly date or 0 otherwise. % o b integer scalar, equal to 1 if str can be interpreted as a quarterly date or 0 otherwise.
% Copyright (C) 2012-2017 Dynare Team % Copyright (C) 2012-2017 Dynare Team
% %
...@@ -45,12 +45,12 @@ end ...@@ -45,12 +45,12 @@ end
%$ date_6 = '1950Y'; %$ date_6 = '1950Y';
%$ date_7 = '1950m24'; %$ date_7 = '1950m24';
%$ %$
%$ t(1) = dassert(isquaterly(date_1),true); %$ t(1) = dassert(isquarterly(date_1),true);
%$ t(2) = dassert(isquaterly(date_2),true); %$ t(2) = dassert(isquarterly(date_2),true);
%$ t(3) = dassert(isquaterly(date_3),true); %$ t(3) = dassert(isquarterly(date_3),true);
%$ t(4) = dassert(isquaterly(date_4),false); %$ t(4) = dassert(isquarterly(date_4),false);
%$ t(5) = dassert(isquaterly(date_5),false); %$ t(5) = dassert(isquarterly(date_5),false);
%$ t(6) = dassert(isquaterly(date_6),false); %$ t(6) = dassert(isquarterly(date_6),false);
%$ t(7) = dassert(isquaterly(date_7),false); %$ t(7) = dassert(isquarterly(date_7),false);
%$ T = all(t); %$ T = all(t);
%@eof:1 %@eof:1
\ No newline at end of file
...@@ -26,7 +26,7 @@ function b = isstringdate(str) % --*-- Unitary tests --*-- ...@@ -26,7 +26,7 @@ function b = isstringdate(str) % --*-- Unitary tests --*--
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ischar(str) if ischar(str)
b = isquaterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); b = isquarterly(str) || isyearly(str) || ismonthly(str) || isweekly(str);
else else
b = false; b = false;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment