--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c7435cd6-b9f3-4cae-9798-5a26f984a5b0o%40googlegroups.com.
One question, I am happy for a yes or no answer, I will find out how later if its clear.
- Can I easily introduce a separate start-date and end-date fields to tiddlers and have the start only as a milestone and somehow reflect when both are used as a range?
- I am keen to make use of created and modified dates independently, but also these separate dates fields, including a separate journal-date.
<$set name="haschanges" filter="[enlist<tiddlers>sameday<thisdate>] [enlist<tiddlers>sameday:created<thisdate>] [<journalTitle>is[tiddler]]">
<$set name="created" filter="[enlist<tiddlers>!title<journalTitle>sameday:created<thisdate>sort[created]]">
<$set name="modified" filter="[enlist<tiddlers>!title<journalTitle>sameday:modified<thisdate>!sort[modified]]">
<$wikify name="events" text=<<getevents>>>
<$wikify name="todays_events" text=<<matchevents>>>
<$vars annual_date={{{ [<date>split[]rest[4]join[]addprefix[....]] }}}><$list filter="[enlist<events>removeprefix<date>] [enlist<events>removeprefix<annual_date>]"><$text text="[["/><$text text={{{ [<currentTiddler>removeprefix[;]] }}}/><$text text="]]"/><br></$list>
The short answer is (currently) "no". Here's a bit more info:
- In the showday() macro, the tiddlers with created/modified dates on that day are identified by:
<$set name="haschanges" filter="[enlist<tiddlers>sameday<thisdate>] [enlist<tiddlers>sameday:created<thisdate>] [<journalTitle>is[tiddler]]">
- Similarly, in the showday_popup() macro, the tiddlers with created/modified dates on that day are identified by:
<$set name="created" filter="[enlist<tiddlers>!title<journalTitle>sameday:created<thisdate>sort[created]]">
<$set name="modified" filter="[enlist<tiddlers>!title<journalTitle>sameday:modified<thisdate>!sort[modified]]">
<$set name="haschanges" filter="[<created>!match[]] [<modified>!match[]] [<journalTitle>is[tiddler]]">
- In the getevents() macro, "events" are loaded in from two types of tiddlers:
- text tiddlers tagged with "events", containing one event per line of text, using format: "YYYYMMDD;Description"
- text tiddlers with an ".ics" suffix, using the iCalendar standard VEVENT text record format (see https://en.wikipedia.org/wiki/ICalendar)
<$list filter="[all[]has[start-date]]">
``[[``{{!!start-date}};{{!!title}}{{{ [{!!description}!match[]then[: ]] }}}{{!!description}}|{{!!title}}``]]``<br>
<$list filter="[<currentTiddler>get[end-date]]" variable="end_date">
<!-- TBD: add entries for each date in between start-date and end-date -->
``[[``{{!!end-date}};{{!!title}}{{{ [{!!description}!match[]then[: ]] }}}{{!!description}}|{{!!title}}``]]``<br>
</$list>
</$list>
<$list filter="[enlist<todays_events>]">
<$vars event_text={{{ [<currentTiddler>split[|]first[]] }}}>
<$vars event_link={{{ [<currentTiddler>split[|]rest[]] }}}>
<$link to={{{ [<event_link>!match[]else<event_text>] }}} tooltip="view tiddler"><$text text=<<event_text>>/></$link>
</$vars>
</$vars>
</$list>
Another update to the http://TiddlyTools.com/timer.html Calendar to support showing "events" for tiddlers that have a "start-date" (and optional "end-date") field...getevents() now generates events for all dates in a range from "start-date" to "end-date" inclusive. see getevents_range().
Rather than specifically addressing journal-date, is there any chance of simply nominating one or more date fields, for which if they are equal to the calendar date they cause the default highlight and appear listed in the drop down on that date?
- The idea is simply to be able to integrate any other solution using a tiddlywiki serial number date in a date field to appear on the calendar.
- The start and end date as you implemented is a range which is a fundamental need in some cases, thank you so much for implementing that.
- It seems to me the ability to place on the calendar tiddlers with any nominated date field on the same day is another fundamental need, although less complex than start and end dates.
1. When one uses the '....MMDD' date format then the event (e.g. birth) is also included for years before that event - I can't quite decide whether it's okay for this to happen so I'm wondering whether there's a way to include a 'start date' for a re-occurring event?
....0724;Eric's Birthday20200724;Eric's Birthday
20210724;Eric's Birthday
20220724;Eric's Birthday
20230724;Eric's Birthday
20240724;Eric's Birthday
2. I thought it would be appropriate to use a field to store, let's say, date of birth or death and then use some 'mechanism' to put the event into an events tagged tiddler. I'm still learning about what 'mechanism' might do this and I may be completely misunderstanding the use of fields but is this a reasonable approach?
\define birthday_tiddler() BirthdayList\define lifetime() [range[$(birthyear)$,$(deathyear)$]]\define makebirthdays()<$vars newline=""><$vars birthyear={{{ [{!!birthdate}split[]first[4]join[]] }}}> <!-- YYYY --><$vars birthdate={{{ [{!!birthdate}split[]rest[4]join[]] }}}> <!-- MMDD --><$vars deathyear={{{ [{!!deathdate}split[]first[4]join[]] }}}> <!-- YYYY --><$set name="deathyear" value=<<deathyear>> emptyValue={{{ [<birthyear>add[100]] }}} ><$button> add birthdays to <$text text=<<birthday_tiddler>>/> <$list filter=<<lifetime>> variable="year"> <$vars event={{{ [<year>addsuffix<birthdate>addsuffix[;Birthday: ]addsuffix<currentTiddler>addsuffix<newline>] }}}> <$list filter="[<birthday_tiddler>!search:text:literal<event>]"> <$action-setfield tag="events" type="text/plain" text={{{ [{!!text}addsuffix<event>] }}}/> </$list> </$vars> </$list></$button>\end<$list filter="[<currentTiddler>has[birthdate]]"> <<makebirthdays>> </$list>Thanks so much for this Eric, it's really helpful. Once I get my head around your script/code, with the help of your notes, I'll have a better understanding of how to do this sort of thing... I'll be playing with this for a while!
So far, I've experienced difficulty using an end-date field in my local 'on this day' project - whenever I include one everything slows down and I get an alert that 'a web page is slowing down your browser' and I have to reload the page to regain control. This seems to happen even if I set the end-date to tomorrow. I guess this is something I've done to slow it down and I need to undertake further tests with your default 'It's About Time!' page.
I also note that using a start-date and end-date in a timeline generates events for each year in the 'view all events' list of the Calendar settings. I guess this is inevitable but it means there are many events generated for each person or subject and, even in your project, there are over 300 events. Will this slow things down?
For an 'on this day' project, it seems one would not want either a birth or a death event (say) to be listed in any year before that date so for Albert Einstein (Born: March 14, 1879; Died: April 18, 1955), no birth event prior to and including 1878 and death event prior to and including 1954. But each event would show thereafter for perpetuity. If I understand correctly, events would only display between the start-date and end-date when the fields are set.
18790314;Albert Einstein born
19550418;Albert Einstein dies
....0314:Albert Einstein's birthday18790314;Albert Einstein born
18800314;Albert Einstein's birthday (1 year old)
18810314;Albert Einstein's birthday (2 years old)
18820314;Albert Einstein's birthday (3 years old)
18830314;Albert Einstein's birthday (4 years old)
... etc ...
19550314;Albert Einstein's birthday (76 years old)
19550418;Albert Einstein dies
I appreciate an 'on this day' calendar would usually display just the current year so I'm wondering whether there is a way to remove options to go backwards or forwards in time so only the current year is shown. However, it might be interesting to see events change as the year changes - going backwards there are likely to be fewer events to display.
Yes. This does tend to slow things down. There's probably a few things I can try to help reduce the processing overhead for "Timeline" handling when there are lots of dates involved. One possibility is to limit the generation of Timeline Events to only match the current year.
Is there a way to colour each calendar? I was trying to get school holidays to show different to public holidays. They are different ics tiddlers.
enjoy,-e
This is probably a silly question, I've not really had a look at this in detail but have admired the updatesfrom a distance.But... Can your stuff be used with/ work with http://kixam.github.io/TW5-visjsTimeline/?
<$visjstimeline filter="[tag[SampleTimeline]]" startDateField="timeline.start" endDateField="timeline.end" format="YYYYMMDD"/>"start-date" -> "timeline.start"
"end-date" -> "timeline.end"
"date-type" -> "timeline.type"
However, I like the "timeline.start" and "timeline.end" fieldnames better, so I changed TiddlyTools/Time/Calendar (and the SampleTimeline event tiddlers) field names:"start-date" -> "timeline.start"
"end-date" -> "timeline.end"
"date-type" -> "timeline.type"
BEFORE:<hr>
<$list filter="[has[start-date]]">
</$list>
<$button> convert timeline fieldnames
<$list filter="[has[start-date]]">
<$action-setfield timeline.start={{!!start-date}} timeline.end={{!!end-date}} timeline.type={{!!date-type}} />
<$action-deletefield $tiddler=<<currentTiddler>> start-date end-date date-type />
</$list>
</$button>
AFTER:<hr>
<$list filter="[has[timeline.start]]">
</$list>
Unfortunately, my 'On This Day' calendar seems to have stopped working. Using my TW with a version of TiddlyTools/Time/Calendar from 12th October 2020 at 4:39am works fine but having updated to yesterday's version (17th October 2020 at 1:22pm) none of my events now show on the calendar. This is probably my fault as the tidders tagged with the event tag are not of type 'text/plain' so that I can get the 'date;detail' information from tiddler fields using, for example, the following where the information is taken from a tiddler for a particular person in the project:....<$view tiddler="Frances Hamilton Arnold (1956-)" field="birth-date" format="date" template="0MM0DD" />;Frances Hamilton Arnold (1956-)My reasoning for doing this is so that I only need to input details once in one place, using fields and then it's available elsewhere in the project. Maybe this is a bad approach but seemed logical to me. If I create a tidder tagged with the event tag making it 'text/plain' then it seems to work fine. I can send you the file to your gmail account if that helps?
<$list filter="[{!!text}splitregexp[\n]trim[]!match[]]" variable="line"><$wikify name="eventdata" text={{!!text}} mode="inline">
<$list filter="[<eventdata>splitregexp[\n]trim[]!match[]]" variable="line">
<$list filter="[has[birth-date]]">
<$view field="birth-date" format="date" template="YYYY0MM0DD" />;<<currentTiddler>><br>
</$list>
<$list filter="[has[birth-date]]">
<$view field="birth-date" format="date" template="....0MM0DD" />;<<currentTiddler>><br>
</$list>
However, I've noticed something else that happened originally, then was 'fixed' but is happening again. When I click on a day in the calendar display where there's an event, say a birth, that's included in an events tagged tiddler called 'Born on this Day' then the link goes to a tiddler called 'Born on this Day: Frances Hamilton Arnold (1956-)' (say), which does not exist. Rather I'd hope it went to a tiddler called 'Frances Hamilton Arnold (1956-)' that does exist and has all the data that generates all the events etc. for that individual. This is what happened before the latest two-line change to getevents_listed().
....MMDD;Frances Hamilton Arnold (1956-)|Frances Hamilton Arnold (1956-)<$list filter="[has[birth-date]]">
<$view field="birth-date" format="date" template="....0MM0DD" />;<<currentTiddler>>|<<currentTiddler>><br>
</$list>
...0202;Ground Hog DayOn Tuesday, October 20, 2020 at 8:18:03 AM UTC-7, Anthony wrote:However, I've noticed something else that happened originally, then was 'fixed' but is happening again. When I click on a day in the calendar display where there's an event, say a birth, that's included in an events tagged tiddler called 'Born on this Day' then the link goes to a tiddler called 'Born on this Day: Frances Hamilton Arnold (1956-)' (say), which does not exist. Rather I'd hope it went to a tiddler called 'Frances Hamilton Arnold (1956-)' that does exist and has all the data that generates all the events etc. for that individual. This is what happened before the latest two-line change to getevents_listed().
As you've noted, an event is linked to a tiddler using "EventList: description text" as the title. This is so that if the same description is used in separate EventLists, they don't link to the same tiddler.
This way, if I have two EventLists, "Bob's Events" and "Jim's Events", where each contains an event like: "....MMDD;My Birthday", they will produce separate links to "Bob Event's: My Birthday" and "Jim Event's: My Birthday".
Fortunately, there is already a way to override this default handling: you can provide a link to specific tiddler title by adding "|TiddlerTitle" following the description textThus, if you enter the following into "Born on this Day":....MMDD;Frances Hamilton Arnold (1956-)|Frances Hamilton Arnold (1956-)it will always link to "Frances Hamilton Arnold (1956-)", regardless of the name of the EventList in which it is defined.The event will still show the EventList title in the Calendar's date popup, but will use the specified title for the link.
Ah, I see what's going on there... great, thank you.Sorry... there's more... I've been playing with dates and noticed that if a date prior to 2 December 1847 is entered in a field (say birth-date) then it's displayed as the previous day... so 18471202 is fine but 18471201 shows as 30th November 1847 (using <Sview with appropriate formatting). Is there something in the TW handles dates?
<$text text={{!!birth-date}}/><br>
LOCAL TIME:
<$view field="birth-date" format="date" template="MMM DDth YYYY 0hh:0mm:0ss" /><br>
UTC:
<$view field="birth-date" format="date" template="[UTC]MMM DDth YYYY 0hh:0mm:0ss" />
Set birth-date to "18831119"...
The LOCAL TIME result will be "November 18th 1883 16:00:00"but the UTC result will be "November 19th 1883 00:00:00"
Set birth-date to "18831118"...The LOCAL TIME result will "November 17th 1883 16:07:02"but the UTC result will be "November 17th 1883 23:59:02"There's some kind of weirdness happening with the time portion of the formatting!
$tw.utils.parseDate = function(value) {
if(typeof value === "string") {
return new Date(Date.UTC(parseInt(value.substr(0,4),10),
parseInt(value.substr(4,2),10)-1,
parseInt(value.substr(6,2),10),
parseInt(value.substr(8,2)||"00",10),
parseInt(value.substr(10,2)||"00",10),
parseInt(value.substr(12,2)||"00",10),
parseInt(value.substr(14,3)||"000",10)));
} else if($tw.utils.isDate(value)) {
return value;
} else {
return null;
}
};
On November 18, 1883, America’s railroads began using a standard time system involving four time zones, Eastern, Central, Mountain and Pacific. Within each zone, all clocks were synchronized. The railroad industry’s plan was adopted by much of the country, although the time-zone system didn’t become official across the United States until the passage of the 1918 Standard Time Act
For accurate dates, regardless of local timezone, add "12" to the end of the date; e.g. "1883111812", which specifies a *time* of "12 noon".Because timezones range from UTC-1200 to UTC+1200, the resulting computed date will be correct by avoiding the effect of thelocaltime timezone offset that shifts the time back (or forward) by up to 12 hours.
I'm in the UK and, it seems for me, that the 'break point' for the date is 2 December 1847. Back to then everything seems to be fine but go to 1 December 1847 and the date displayed is a day earlier, so 30 November 1847 in this case. I don't see a problem at 18 November 1883 when standardized time zones introduced in the USA. I'm not sure what this means!
On Tuesday, October 20, 2020 at 8:18:03 AM UTC-7, Anthony wrote:However, I've noticed something else that happened originally, then was 'fixed' but is happening again. When I click on a day in the calendar display where there's an event, say a birth, that's included in an events tagged tiddler called 'Born on this Day' then the link goes to a tiddler called 'Born on this Day: Frances Hamilton Arnold (1956-)' (say), which does not exist. Rather I'd hope it went to a tiddler called 'Frances Hamilton Arnold (1956-)' that does exist and has all the data that generates all the events etc. for that individual. This is what happened before the latest two-line change to getevents_listed().As you've noted, an event is linked to a tiddler using "EventList: description text" as the title. This is so that if the same description is used in separate EventLists, they don't link to the same tiddler.
....MMDD;My Birthday|Bob's Birthday
....MMDD;My Birthday|Jim's Birthday....MMDD;Frances Hamilton Arnold (1956-)<$list filter="[has[birth-date]]">
<$view field="birth-date" format="date" template="....0MM0DD" />;<<currentTiddler>><br>
</$list>2) So, I started to wonder, "Is there something special about November 18, 1883?"... and this is what I found:Which says:On November 18, 1883, America’s railroads began using a standard time system involving four time zones, Eastern, Central, Mountain and Pacific. Within each zone, all clocks were synchronized. The railroad industry’s plan was adopted by much of the country, although the time-zone system didn’t become official across the United States until the passage of the 1918 Standard Time ActSo, it appears that the strange time output is related to the original creation of standardized time zones!