summaryrefslogtreecommitdiff
path: root/src/date_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 17:42:12 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 17:42:12 +0000
commitfb5ecb94992e7febf4bc059cb6ec4a51f50c66b0 (patch)
tree87956636c318baa8d5d8d62f13263c4f64dbe881 /src/date_func.h
parent4d5dbf51707c42c24eeafdb65016b079c54adcf2 (diff)
downloadopenttd-fb5ecb94992e7febf4bc059cb6ec4a51f50c66b0.tar.xz
(svn r22411) -Document: another bunch of bits
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 38e310a87..6bbde5955 100644
--- a/src/date_func.h
+++ b/src/date_func.h
@@ -24,6 +24,11 @@ void SetDate(Date date, DateFract fract);
void ConvertDateToYMD(Date date, YearMonthDay *ymd);
Date ConvertYMDToDate(Year year, Month month, Day day);
+/**
+ * Checks whether the given year is a leap year or not.
+ * @param yr The year to check.
+ * @return True if \c yr is a leap year, otherwise false.
+ */
static inline bool IsLeapYear(Year yr)
{
return yr % 4 == 0 && (yr % 100 != 0 || yr % 400 == 0);