Date
- Correctly performs Nibbler save/restore for parse attempts.
This commit is contained in:
@@ -143,16 +143,19 @@ Date::Date (
|
|||||||
|
|
||||||
// Parse a formatted date.
|
// Parse a formatted date.
|
||||||
Nibbler n (input);
|
Nibbler n (input);
|
||||||
|
n.save ();
|
||||||
#ifdef NIBBLER_FEATURE_DATE
|
#ifdef NIBBLER_FEATURE_DATE
|
||||||
if (n.getDate (format, _t) && n.depleted ())
|
if (n.getDate (format, _t) && n.depleted ())
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Parse an ISO date.
|
// Parse an ISO date.
|
||||||
|
n.restore ();
|
||||||
if (iso && n.getDateISO (_t) && n.depleted ())
|
if (iso && n.getDateISO (_t) && n.depleted ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Perhaps it is an epoch date, in string form?
|
// Perhaps it is an epoch date, in string form?
|
||||||
|
n.restore ();
|
||||||
if (epoch && isEpoch (input))
|
if (epoch && isEpoch (input))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user