summaryrefslogtreecommitdiff
path: root/src/date_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/date_func.h')
-rw-r--r--src/date_func.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/date_func.h b/src/date_func.h
index d196fdb52..8c484b2c4 100644
--- a/src/date_func.h
+++ b/src/date_func.h
@@ -16,4 +16,9 @@ void SetDate(Date date);
void ConvertDateToYMD(Date date, YearMonthDay *ymd);
Date ConvertYMDToDate(Year year, Month month, Day day);
+static inline bool IsLeapYear(Year yr)
+{
+ return yr % 4 == 0 && (yr % 100 != 0 || yr % 400 == 0);
+}
+
#endif /* DATE_FUNC_H */