From ac428e1f1a3ee6b4cfa5eba887322083b2b08330 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 14:23:41 -0400 Subject: [PATCH] ISO8601d: Added ::dayOfWeek --- src/ISO8601.cpp | 7 +++++++ src/ISO8601.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index d9ef406f3..3985b34a7 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -954,6 +954,13 @@ int ISO8601d::weekOfYear (int weekStart) const return weekNumber; } +//////////////////////////////////////////////////////////////////////////////// +int ISO8601d::dayOfWeek () const +{ + struct tm* t = localtime (&_date); + return t->tm_wday; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index db35dff1d..9830c7177 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -58,6 +58,7 @@ public: int day () const; int year () const; int weekOfYear (int) const; + int dayOfWeek () const; private: void clear ();