calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Date.is_leap_day seems wrong

Open twopir opened this issue 6 years ago • 2 comments

utop [21]: Date.is_leap_year 2000;;
- : bool = true
utop [22]: Date.is_leap_day (Date.make 2000 2 29);;
- : bool = false

https://github.com/ocaml-community/calendar/blob/a447a88ae3c1e9873e32d2a95d3d3e7c5ed4a7da/src/date.ml#L212

This seems to just be defined incorrectly.

twopir avatar Apr 08 '19 00:04 twopir

Or I could read the FAQ — sorry!

https://github.com/ocaml-community/calendar/blob/a447a88ae3c1e9873e32d2a95d3d3e7c5ed4a7da/calendarFAQ-2.6.txt#L663

twopir avatar Apr 08 '19 00:04 twopir

The behavior may be correct, but it should be explained in the documentation of the function, not lost in the FAQ that most people don't know exist. :)

Drup avatar Apr 08 '19 12:04 Drup