Nibbler: Migrated from Date to ISO8601d

This commit is contained in:
Paul Beckingham
2015-10-03 18:02:55 -04:00
parent 9a5def4c95
commit 8136a59572

View File

@@ -33,7 +33,6 @@
#include <Nibbler.h> #include <Nibbler.h>
#ifdef NIBBLER_FEATURE_DATE #ifdef NIBBLER_FEATURE_DATE
#include <ISO8601.h> #include <ISO8601.h>
#include <Date.h>
#endif #endif
#ifdef NIBBLER_FEATURE_REGEX #ifdef NIBBLER_FEATURE_REGEX
#include <RX.h> #include <RX.h>
@@ -859,7 +858,7 @@ bool Nibbler::getDate (const std::string& format, time_t& t)
// now. // now.
if (year == -1) if (year == -1)
{ {
Date now = Date (); ISO8601d now;
year = now.year (); year = now.year ();
if (month == -1) if (month == -1)
{ {
@@ -890,7 +889,7 @@ bool Nibbler::getDate (const std::string& format, time_t& t)
second = (second == -1) ? 0 : second; second = (second == -1) ? 0 : second;
// Check that values are correct // Check that values are correct
if (! Date::valid (month, day, year, hour, minute, second)) if (! ISO8601d::valid (month, day, year, hour, minute, second))
return false; return false;
// Convert to epoch. // Convert to epoch.