]> pilppa.org Git - libplp.git/blobdiff - src/Date.cc
Data read optimizations
[libplp.git] / src / Date.cc
index 368fafa2c12814e03089af08771ca21a06310793..e8314771a0858286ae945f8342f26bab8084b5b4 100644 (file)
@@ -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)) {