-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix calendar handling of pre-1970 birthdates #473
base: master
Are you sure you want to change the base?
Conversation
Re submit PR FossifyOrg#224, all credits to @TristanDonze. I cannot do a build right now, but I can more than happily test a beta build if needed.
A test build should be available under checks tab soon :) |
Awesome. I did not see any potential side effects, but running a test build is always a good idea. Thanks and sorry for the trouble. |
Hmm, I think now I understand why the check for years before 1970 was added: for events (birthdays or anniversaries) without an year, the age is calculated using the year 1604, resulting in ages like 420 years for these events in 2024, for instance. Anyway, limiting the date to 1970 is even worse IMHO...
@naveensingh Thoughts? Do you want me to simply add a TODO to remind about item 1) or try to do 2)? |
This is the way. I don't think we need a lot of changes for it, just adding var missingYear = false
// private contacts are created in Simple Contacts Pro, so we can guarantee that they exist only in these 2 formats
val format = if (birthdayAnniversary.startsWith("--")) {
missingYear = true
"--MM-dd"
} else {
"yyyy-MM-dd"
}
var flags = if (missingYear) {
FLAG_ALL_DAY or FLAG_MISSING_YEAR
} else {
FLAG_ALL_DAY
}
// use flags... I have not tested this but it should work. |
Events without an year are not handled properly, this should fix it as discussed [here](FossifyOrg#473 (comment)).
Oh, great. I missed the block above for other events, it indeed seems to handle events without an year properly. I was going to ask to to trigger a new build in my fork, but it seems that it was triggered here already. I hope it works fine now! |
It seems to be working just fine:
Just a remark: in the release notes, it may be a good idea to point out that birthdays and anniversaries will have to be imported again so the Calendar app will display them properly. Cheers! |
Great, thanks! |
Re submit PR #224, all credits to @TristanDonze.
I cannot do a build right now, but I can more than happily test a beta build if needed (and update the PR with any necessary changes if required, of course).
What is it?
Description of the changes in your PR
Before/After Screenshots/Screen Record
Fixes the following issue(s)
Acknowledgement