Skip to content
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

Feature request: Add option to get any dates #96

Open
tukusejssirs opened this issue Oct 16, 2019 · 13 comments
Open

Feature request: Add option to get any dates #96

tukusejssirs opened this issue Oct 16, 2019 · 13 comments

Comments

@tukusejssirs
Copy link

I’d like to use your gedcom utility to get all dates from my .ged file and then create an .ical file which I’d import into my calendar.

By all dates I mean:

  • birth dates,
  • baptism dates,
  • marriage dates,
  • start and end of education at particular school (not needed for my current purpose),
  • start and end of work at particular company/position (not needed for my current purpose),
  • death dates,
  • funeral dates,
  • dates based on custom tag (like confirmation dates).

I would be nice to be able to get:

  • all of these dates at once,
  • select dates (one could select one or more of these dates).
@nigelhorne
Copy link
Owner

Nice idea. Let me think about it. I've done ical integration before so I should be able to leverage that code.

@tukusejssirs
Copy link
Author

Thank you in advance. ;)

nigelhorne added a commit that referenced this issue Oct 16, 2019
@nigelhorne
Copy link
Owner

Commit 2522a45 creates an ICS file with birthdays - can you see if that works for you? If so I can easily add other events.

@tukusejssirs
Copy link
Author

How to that option? ./gedcom -i [file].ged does not work (outputs the usage info). I see it can generate ICS file, but would be nice if I could specify:

  • that I want to process all or select persons (except those that does not have the date set);
  • what dates to include (I believe that currently I can get only birth and death dates—it’d be nice to have either or both of them);
  • the format of the description (I would like to use ?D: [surname(s)], [name(s)] [year], where ? is B for birthdays and D for death days);
  • probably even the notification time would be nice to be able to change (I prefer 9:00 am on the day and 9:00 am on the day before).

@nigelhorne
Copy link
Owner

Say ./gedcom -i file.ics file.ged, it will create the ICS file in the file file.ics

@tukusejssirs
Copy link
Author

tukusejssirs commented Oct 17, 2019

Yes, it works. Few issues:

  • of couse, parsing names has issues;
  • the start date time is always T220000Z
    • event start date should be midnight;
  • end date is not defined (see this SO answer why DTEND should be specified).
  • user should be able to define the notification time themself;
  • user should be able to define the timezone; by default it should be the current locale timezone (my timezone is CE(S)T, i.e. currently +2:00 hours)

I regard these days as birthdays, i.e. the whole day (24 h) is a birthday date.

@nigelhorne
Copy link
Owner

the +2:00 comes from this bug in https://metacpan.org/pod/Data::ICal:

Data::ICal does not support time zone daylight or standard entries, so
       time zone components are basically useless

@tukusejssirs
Copy link
Author

I see. What about DateTime::TimeZone::ICal?

@nigelhorne
Copy link
Owner

I've tried using Date::ICal::TimeZone with what I believe to be success. Please take a look.

@tukusejssirs
Copy link
Author

I’ll check it out tomorrow (CEST).

@tukusejssirs
Copy link
Author

  1. The BEGIN section still cannot install dependencies Data::ICal::DateTime, Data::ICal::TimeZone.

  2. I would add an option to specify calendar name (X-WR-CALNAME). Currently it is $0 Family Calendar, in my case ./gedcom Family Calendar.

  3. You have indeed fixed the +2 hours bug.

  4. I would reverse the order of DTSTART and DTEND. Currently, it output end date before start date.

  5. Add an option to specify timezone (X-WR-TIMEZONE). It should be default get the user locale timezone, but still there should be an option to alter the timezone. We could then use UTC timezone in dates (see this SO answer. Then I would remove TZID=floating from DTSTART and DTEND. Probably too complicated to even try to implement.

  6. Add an option to specify calendar description (X-WR-CALDESC).

  7. Google also adds the following to specify timezone and DST related settings in the calendar. I know that the calculation of the daylight settings is a bit of a complication as it changes from time to time (e.g. EU countries should get rid of DST by 2021).

BEGIN:VTIMEZONE
TZID:Europe/Bratislava
X-LIC-LOCATION:Europe/Bratislava
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
  1. You could also add DTSTAMP which is a timestamp of time of the calendar creation. This should be added to each and every event.

  2. User could have an option to specify DESCRIPTION format. This could be a shot description of the person (e.g. names, surnames, date of birth, date of death).

  3. You could add LOCATION of the event, like birth place for birthdays.

Note that I use only Google Calendar and that all my suggestions above are based on an exported Google Calendar.

Also note that X-WR-* are calendar extensions. You might want to add an option to use calendar extensions.

@nigelhorne
Copy link
Owner

All the dates that are relatively easy to do should now be in the ICS file. There is no means to specify a list of names, though the -p and -s options should work in conjunction with the -i option (I've not tried that yet).

@nigelhorne
Copy link
Owner

I have reworked the -s option to work with more places, that may also help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants