From f8ed0f96340897a050af0698c2a40bbc48079883 Mon Sep 17 00:00:00 2001 From: wayfarerbasta Date: Thu, 21 Mar 2019 10:31:09 +0100 Subject: [PATCH] Update ezTime.cpp The Function makeOrdinalTime does not work properly if you set the ordinal to 5 (Last dow in month and year) because you check if the value w is equal to 0 for the "Last week" rule. This will never happen. With the check if (w == 5) or if (ordinal ==0) the code works perfectly. This change fixes the issue #38 --- src/ezTime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ezTime.cpp b/src/ezTime.cpp index 273c0a9..f7240fb 100644 --- a/src/ezTime.cpp +++ b/src/ezTime.cpp @@ -334,7 +334,7 @@ namespace ezt { uint8_t m = month; uint8_t w = ordinal; if (w == 5) ordinal = 0; - if (w == 0) { // is this a "Last week" rule? + if (w == 5) { // is this a "Last week" rule? if (++m > 12) { // yes, for "Last", go to the next month m = 1; ++year;