changed: when parsing date skip 'Z' character if exists (iso format)

git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1126 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2018-09-19 21:24:23 +00:00
parent 239e1e4674
commit 8e9f83e377
1 changed files with 9 additions and 0 deletions

View File

@ -800,6 +800,7 @@ bool Date::Parse(const CStringType * str, const CStringType ** str_after)
{
const CStringType * after;
bool result = false;
bool is_iso = false;
if( ParseYearMonthDay(str, &after) )
{
@ -811,10 +812,18 @@ bool result = false;
// https://en.wikipedia.org/wiki/ISO_8601
// at the moment skip the 'T' character only
after += 1;
is_iso = true;
}
if( ParseHourMinSec(after, &after) )
{
result = true;
if( is_iso && *after == 'Z' )
{
after += 1;
}
}
}
SetAfter(after, str_after);