summaryrefslogtreecommitdiff
path: root/src/date_func.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-06-20 21:14:10 +0000
committerfrosch <frosch@openttd.org>2008-06-20 21:14:10 +0000
commit4236dd3be5c4c5c130551f625f3459a4c733bfc3 (patch)
tree9f0f3597960d1562c26a18b355f4fa2e98db5a01 /src/date_func.h
parentc406ea35eccd7a7af576ce4d7f2adad2d9a13573 (diff)
downloadopenttd-4236dd3be5c4c5c130551f625f3459a4c733bfc3.tar.xz
(svn r13594) -Feature(ette)[FS#2093]: Supply newgrfs with 'day of month', 'leap year' and 'day of year'.
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 */