Lotus Notes has a decent calendar which can also handle recurring events. Even so, and due to The Power Of Plain Text I prefer to “manage” anniversaries in a simple text file. That isn’t quite true, but at least I can produce a simple text file, one date per line in DD.MM.YYYY format like so:

28.05.1962 JP
06.09.     Sue

Note how the year is skipped if it is unknown. A simple Perl program

#!/usr/bin/perl

use strict;

die "Usage: $0 CalendarYear" if ($#ARGV != 0);
my $calyear = $ARGV[0];  # e.g. '2005': Year for calendar entry

open(IN, "bd-sort.txt") || die;
while (<IN>) {
 s/\s+$//g;
 my ($bdate, $name) = split(/\s+/, $_, 2);
 my ($day, $month, $year) = split(/\./, $bdate);

  # Output year in which to enter into calendar
  print "$calyear:$month:$day:$name:Birthday $bdate\n";
}

massages the input into output suitable for an import formula to Lotus Notes:

2005:05:28:JP:Birthday 28.05.1962
2005:09:06:Sue:Birthday 06.09.

That should be stored into a whatever.txt file which can then be imported into Lotus Notes with a suitable COL definition file. The one I use looks like this:

year:  type number until ":"
birthmonth: type number until ":"
birthday: type number until ":"
person:  type text until ":"
Body:  type text until ""

FORMULASTART
 FIELD Form  := "Appointment";
 FIELD jBirthDayReminder := "1";
 FIELD From  := "me@example.com";
 FIELD Chair  := "CN=Your Name/O=example";
 FIELD Principal :=  "CN=Your Name/O=example";
 FIELD Subject  := "[BD] " + @Text(person);
 FIELD AppointmentType := "4";
 FIELD STARTDATETIME := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD CalendarDateTime := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD EndDateTime := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD EndDate  := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD EndTime  := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD ReminderTime := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD StartDate := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD $NoPurge  := @Date( year ; birthmonth ; birthday ; 10 ; 00 ; 00);
 FIELD Duration  := 1;
 FIELD ExcludeFromView :=  ("D" : "S");
 FIELD OrgConfidential := @Text("1");
 FIELD OrgTable  := "C0";
 FIELD _ViewIcon :=  10;
 FIELD Location  := "";
 FIELD MailOptions := "0";

 FIELD Repeats := "";
 FIELD Resources := "";
 FIELD SequenceNum := 1;
 FIELD Sign := "0";
 
 FIELD birthday  := @DeleteField;
 FIELD birthmonth := @DeleteField;
 FIELD person  := @DeleteField;
FORMULAEND

There we go. That was quite easy, what? I do the import once a year, towards New Year’s Eve.

Comments

blog comments powered by Disqus