From 17185c79117b5e34b564c340236eda0caa2ddb28 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 14:18:54 -0400 Subject: [PATCH] ISO8601d: Added ::week --- src/ISO8601.cpp | 6 ++++++ src/ISO8601.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index c8c1631cb..881ca3849 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -913,6 +913,12 @@ int ISO8601d::month () const return t->tm_mon + 1; } +//////////////////////////////////////////////////////////////////////////////// +int ISO8601d::week () const +{ + return ISO8601d::weekOfYear (ISO8601d::dayOfWeek (ISO8601d::weekstart)); +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 466e40d7e..9889da8fd 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -54,6 +54,7 @@ public: static int length (const std::string&); int month () const; + int week () const; private: void clear ();