From e41e8effdf3551898aa063a1e7e3bf39a9970690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 13 Jun 2014 10:10:17 +0200 Subject: [PATCH] Modified isdate behaviour (an integer scalar is interpreted as a year). --- matlab/utilities/dates/isdate.m | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/matlab/utilities/dates/isdate.m b/matlab/utilities/dates/isdate.m index 2fb603803..67bfcdb2d 100644 --- a/matlab/utilities/dates/isdate.m +++ b/matlab/utilities/dates/isdate.m @@ -25,11 +25,12 @@ function b = isdate(str) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -%if length(str)>1 - b = isquaterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); - %else - %b = 0; - %end +if isnumeric(str) && isscalar(str) + b = 1; + return +end + +b = isquaterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); %@test:1 %$