Using $PublicationYear data for a Timeline view

So, you’ve imported a load of references from Bookends (or possibly another Ref Mgr app) and all refs has a $PublicationYear. But the latter is a String-type and timeline needs a Date, indeed, the view won’t initialise unless one in-scope note has a $StartDate.

This stamp addresses that setting $StartDate to 1 January 12:00:00 of the $PublicationYear:

$StartDate=date($PublicationYear,1,1,12,0,0);

Of course if you’ve more granular publication dates (e.g. the refs are a monthly journal or such) then adjust the $StartDate accordingly.


Edge case: you don’t want to use $StartDate for the Timeline

Perhaps you need use $StartDate/$EndDate for other purposes, so the values are wrong for the above task. Well, we know Timeline view defaults to using $StartDate/$EndDate. Those attribute choices this can be customised in the view’s settings panel. However, here you hit a chick & egg sequencing problem as you can’t get to that panel until you have a Timeline view tab whilst a Tab will not initialise as Timeline view unless it has at least one valid (default) data value, i.e. a $StartDate in at least one-scope note.

So, you need to set $StartDate in just one note, allowing the view to initialise so you can access and change the settings for your desired Date-type attributes for plotted timeline items. The ‘sacrificial’ $StartDate value you made can now be deleted (or corrected back to its original value) and your Timeline of references is ready to use.

1 Like

For reference, this is using date(dateStr).

Ah, good point, and thanks to @PaulWalters for spotting that omission.

Actually, and without implied critique, the stamp uses the other date() construction form, i.e. date(yearNum, monthNum, dayNum[, hourNum, minNum]).

I only note this as aTbRef lists them separately and, my error(!), I’d not thought to cross-referenced the two styles of specifying a date.

To-do now done. The two date() construction operator pages are cross-linked (the operator web pages only for the now). The cross-ref is in paragraph 1 in each case giving early notice of the possible alternate approach.

I’d say this multi-argument date() for is the less used/seen but it resolves the case where you know all the parts of the date/time that you want when making a date. The other String-type single-argument form is the one most generally found when coercing dates-stored-as-string back into Date-type data.