X-Git-Url: http://pilppa.org/gitweb/?p=libplp.git;a=blobdiff_plain;f=src%2FDate.cc;h=e8314771a0858286ae945f8342f26bab8084b5b4;hp=368fafa2c12814e03089af08771ca21a06310793;hb=fb1be129d4304d68e42f3e30710968a0899e5482;hpb=88183ebdd35a2bd340d949382f593466dfc887de diff --git a/src/Date.cc b/src/Date.cc index 368fafa..e831477 100644 --- a/src/Date.cc +++ b/src/Date.cc @@ -243,6 +243,24 @@ void Date::next_hour() { } } +bool Date::is_last_day_of_month() { + bool ret_val; + int days_in_month; + + days_in_month = -1; + if ((month > 0) && + (month <= 12)) { + days_in_month = CONST__DAYS_PER_MONTH[month - 1]; + if ((month == 2) && + (is_leap_year() == true)) { + days_in_month = 29; + } + } + ret_val = (day == days_in_month); + //log_debug("ret_val: %d", ret_val); + return ret_val; +} + void Date::next_day() { if ((month > 0) && (month <= 12)) {