nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
989 stars 240 forks source link

birthday calendar: show age instead of birth year #940

Open johkoenig opened 6 years ago

johkoenig commented 6 years ago

Steps to reproduce

  1. Add people with birthdays to your contacts app
  2. Have a look at the birthday calendar

Expected behaviour

If somebody is born on August 1st, 1976, then the calendar of August 2018 should show "John Doe (42)" The birthday date could be atted to the notes.

Actual behaviour

The calendar shows "John Doe (*1976)".

Server configuration

Server version: 14.0.3 Calendar version: 1.6.3

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/65826715-birthday-calendar-show-age-instead-of-birth-year?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github).
tcitworld commented 6 years ago

Isn't this a server issue ?

georgehrke commented 6 years ago

@tcitworld Displaying the age is nothing we can practically do on the server, because it prevents us from using RRULE. My idea was to introduce a property that stores just the birth year and to generate the age in browser: https://github.com/nextcloud/server/pull/11832/files#diff-e96c57f9fa60e361112de26af7457146R247

johkoenig commented 6 years ago

This probably needs some larger remodeling. As far as I can see it out of your code, right now you're creating a series appointment every year with the same text "John Doe (*1976)". You'll probably need to recode this to create a single appointment each year with a different text "John Doe (1)", "John Doe (2)", ... I don't know if theres a nicer way of doing this.

georgehrke commented 6 years ago

You'll probably need to recode this to create a single appointment each year with a different text "John Doe (1)", "John Doe (2)",

@johkoenig Then we end up having at least 100 times as many birthday events, not to mention that updating a contact will also result in 100 update queries .... So that's not really something I'm willing to do.

My idea was to keep John Doe (*1976) in the ics files (so mobile / desktop clients still see that), but then calculate the actual age in the calendar app.

johkoenig commented 6 years ago

The downside of this is that e.g. in Thunderbird, I still only see John Doe (*1976). On the iPhone it's not so much of a problem, because the iPhone creates a birthday calendar by itself. I don't know how android handles this.

tcitworld commented 6 years ago

@johkoenig If you want to discuss this more feel free to open an issue in the server repo.

ypid-geberit commented 6 years ago

I don't know how android handles this.

The Android Open Source Project (AOSP) as of 9.0 does not handle this e.g. does not support a birthday calendar. Non-vanilla Android versions (vendor modified) might have native support for this. In any case, Birthday Adapter does exactly what you proposed (generates calendar events like "John Doe (42)").

johkoenig commented 6 years ago

@ypid-geberit Thats good to know. My iPhone does the same, based on the data from the contact storage. However, this issue is about the nextcloud calender. @tcitworld I'll carry it over to server.

call-me-matt commented 3 years ago

I am very interested in this feature, too. In case there is a solution, I would love it if round birthdays could be highlighted so I can consider them in my planning without the need to check each entry.

pxlfrk commented 3 years ago

i am also interested in this feature. Is there any oppurtunity to see this coming to the app? This could be a setting for the contact-app wether to show the year of birth or the age of the birthday.