From b6aced87269cd2755b16638faf75a3e2af8acc46 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 16:14:12 -0400 Subject: [PATCH] ISO8601d: Added ::startOfMonth --- src/ISO8601.cpp | 6 ++++++ src/ISO8601.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 3e740296f..444907c3b 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -854,6 +854,12 @@ ISO8601d ISO8601d::startOfWeek () const return ISO8601d (sow.month (), sow.day (), sow.year ()); } +//////////////////////////////////////////////////////////////////////////////// +ISO8601d ISO8601d::startOfMonth () const +{ + return ISO8601d (month (), 1, year ()); +} + //////////////////////////////////////////////////////////////////////////////// // Static bool ISO8601d::leapYear (int year) diff --git a/src/ISO8601.h b/src/ISO8601.h index 97f9d6f39..062a0c961 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -48,6 +48,7 @@ public: ISO8601d startOfDay () const; ISO8601d startOfWeek () const; + ISO8601d startOfMonth () const; static bool leapYear (int); static int daysInMonth (int, int);