pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

29 Feb birthdays not displayed #597

Closed madduck closed 7 years ago

madduck commented 7 years ago

The birthday calendar does not display birthdays by people born on 29 Feb, unless it's a leap year I assume. Generally, it should display the birthday on 1 Mar instead.

geier commented 7 years ago

If anyone wants to sent a PR for this, please do. If you need any help, feel free to contact us here or on irc (#pimutils @Freenode).

Suggestion on how to proceed: in khal/khalendar/backend.update_birthday(): add new conditional if bday is 29th of Feb, if so, create a recurrent event on the 60th day of every year.

Please then write a test, you can probably copy and modify a test from tests/backend_test.py, and test for at least a leap and a non leap year.

geier commented 7 years ago

@madduck I guess the current implementation is technically correct, but it would probably more helpful if those birthdays get shown on the 1st of march in non-leap years.

WhyNotHugo commented 7 years ago

I guess the current implementation is technically correct

Nope, not really. Technically, birthdays happen every year. 😝

pfertyk commented 7 years ago

Should the event be displayed on March 1 or February 28? If it's shown in March, then the person having birthday in February will be celebrating it in March 3 out of 4 times.

https://en.wikipedia.org/wiki/February_29#Born_on_February_29

According to this people can celebrate their birthday either on February 28 or March 1. Should this be configurable?