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
commitaadd3b29af948f26286290b504664c7272c3c4c1 (patch)
tree9f0f3597960d1562c26a18b355f4fa2e98db5a01 /src/date_func.h
parent3d56c0744045a4e57e9a2e65955972c3dd2c1720 (diff)
downloadopenttd-aadd3b29af948f26286290b504664c7272c3c4c1.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 */