gedcom
gedcom copied to clipboard
Feature request: Add option to get any dates
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).
Nice idea. Let me think about it. I've done ical integration before so I should be able to leverage that code.
Thank you in advance. ;)
Commit https://github.com/nigelhorne/gedcom/commit/2522a45acc44a33c11f514c451382fd02ac6a32d creates an ICS file with birthdays - can you see if that works for you? If so I can easily add other events.
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?
isB
for birthdays andD
for death days); - probably even the notification time would be nice to be able to change (I prefer
9:00 am on the day
and9:00 am on the day before
).
Say ./gedcom -i file.ics file.ged
, it will create the ICS file in the file file.ics
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.
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
I see. What about DateTime::TimeZone::ICal
?
I've tried using Date::ICal::TimeZone with what I believe to be success. Please take a look.
I’ll check it out tomorrow (CEST).
-
The
BEGIN
section still cannot install dependenciesData::ICal::DateTime
,Data::ICal::TimeZone
. -
I would add an option to specify calendar name (
X-WR-CALNAME
). Currently it is$0 Family Calendar
, in my case./gedcom Family Calendar
. -
You have indeed fixed the +2 hours bug.
-
I would reverse the order of
DTSTART
andDTEND
. Currently, it output end date before start date. -
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 removeTZID=floating
fromDTSTART
andDTEND
. Probably too complicated to even try to implement. -
Add an option to specify calendar description (
X-WR-CALDESC
). -
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
-
You could also add
DTSTAMP
which is a timestamp of time of the calendar creation. This should be added to each and every event. -
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). -
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.
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).
I have reworked the -s option to work with more places, that may also help.