diff --git a/src/Config.cpp b/src/Config.cpp index f726176e0..f6617f766 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -574,7 +574,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data) auto loc = _defaults.find ("data.location=~/.task"); // loc+0^ +14^ +21^ - Date now; + ISO8601d now; std::stringstream contents; contents << "# [Created by " << PACKAGE_STRING diff --git a/src/columns/ColDate.cpp b/src/columns/ColDate.cpp index a35a6d386..6bc4e87c7 100644 --- a/src/columns/ColDate.cpp +++ b/src/columns/ColDate.cpp @@ -89,7 +89,7 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim if (format == "") format = context.config.get ("dateformat"); - minimum = maximum = Date::length (format); + minimum = maximum = ISO8601d::length (format); } else if (_style == "countdown") { diff --git a/src/columns/ColDescription.cpp b/src/columns/ColDescription.cpp index abf376db9..4d4304e47 100644 --- a/src/columns/ColDescription.cpp +++ b/src/columns/ColDescription.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ ColumnDescription::ColumnDescription () if (_dateformat == "") _dateformat = context.config.get ("dateformat"); - std::string t = Date ().toString (_dateformat); + std::string t = ISO8601d ().toString (_dateformat); std::string d = STRING_COLUMN_EXAMPLES_DESC; std::string a1 = STRING_COLUMN_EXAMPLES_ANNO1; std::string a2 = STRING_COLUMN_EXAMPLES_ANNO2; @@ -102,7 +102,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int if (task.annotation_count) { - unsigned int min_anno = _indent + Date::length (_dateformat); + unsigned int min_anno = _indent + ISO8601d::length (_dateformat); if (min_anno > minimum) minimum = min_anno; @@ -132,7 +132,7 @@ void ColumnDescription::measure (Task& task, unsigned int& minimum, unsigned int if (task.annotation_count) { - auto min_anno = Date::length (_dateformat); + auto min_anno = ISO8601d::length (_dateformat); std::map annos; task.getAnnotations (annos); for (auto& i : annos) @@ -187,7 +187,7 @@ void ColumnDescription::render ( { for (auto& i : annos) { - Date dt (strtol (i.first.substr (11).c_str (), NULL, 10)); + ISO8601d dt (strtol (i.first.substr (11).c_str (), NULL, 10)); description += "\n" + std::string (_indent, ' ') + dt.toString (_dateformat) + " " + i.second; } } @@ -218,7 +218,7 @@ void ColumnDescription::render ( { for (auto& i : annos) { - Date dt (atoi (i.first.substr (11).c_str ())); + ISO8601d dt (strtol (i.first.substr (11).c_str (), NULL, 10)); description += " " + dt.toString (_dateformat) + " " + i.second; } } diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 9ea606b5c..924b487b5 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -744,7 +744,7 @@ void Chart::generateBars () { case 'D': // month/day { - std::string month = Date::monthName (cursor.month ()); + std::string month = ISO8601d::monthName (cursor.month ()); bar._major_label = month.substr (0, 3); sprintf (str, "%02d", cursor.day ()); diff --git a/src/commands/CmdHistory.cpp b/src/commands/CmdHistory.cpp index dc81af131..4280d6387 100644 --- a/src/commands/CmdHistory.cpp +++ b/src/commands/CmdHistory.cpp @@ -478,7 +478,7 @@ int CmdGHistoryMonthly::execute (std::string& output) view.set (row, 0, y); priorYear = y; } - view.set (row, 1, Date::monthName(m)); + view.set (row, 1, ISO8601d::monthName(m)); unsigned int addedBar = (widthOfBar * addedGroup[i.first]) / maxLine; unsigned int completedBar = (widthOfBar * completedGroup[i.first]) / maxLine; diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp index 775213f69..4afa20393 100644 --- a/src/commands/CmdTimesheet.cpp +++ b/src/commands/CmdTimesheet.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +65,7 @@ int CmdTimesheet::execute (std::string& output) std::vector all = context.tdb2.all_tasks (); // What day of the week does the user consider the first? - int weekStart = Date::dayOfWeek (context.config.get ("weekstart")); + int weekStart = ISO8601d::dayOfWeek (context.config.get ("weekstart")); if (weekStart != 0 && weekStart != 1) throw std::string (STRING_DATE_BAD_WEEKSTART);