diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 444907c3b..7abb1b79d 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -860,6 +860,12 @@ ISO8601d ISO8601d::startOfMonth () const return ISO8601d (month (), 1, year ()); } +//////////////////////////////////////////////////////////////////////////////// +ISO8601d ISO8601d::startOfYear () const +{ + return ISO8601d (1, 1, year ()); +} + //////////////////////////////////////////////////////////////////////////////// // Static bool ISO8601d::leapYear (int year) diff --git a/src/ISO8601.h b/src/ISO8601.h index 062a0c961..44373f220 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -49,6 +49,7 @@ public: ISO8601d startOfDay () const; ISO8601d startOfWeek () const; ISO8601d startOfMonth () const; + ISO8601d startOfYear () const; static bool leapYear (int); static int daysInMonth (int, int);