Two Questions about the Moments Plugin for parsing Dates for history Timelines

119 views
Skip to first unread message

Jan

unread,
Oct 10, 2018, 6:30:37 AM10/10/18
to TiddlyWiki
Hello,
I am buillding an Art-History-Timeline for a Course which can be found
here: http://szenio.de/Kunstgeschichte/
It makes use of Kixam`s/Emkay´s Timelineplugin which is based on the
vis.js plugin.
It also includes an application of the moments.js plugin.

For my particular use two questions.
-Could we get the plugin to parse more than one date format? For example
in my usecase there is exact dates and timespans where exact dates are
not appropriate (Like the Renaissance or so)
-How can I enter dates BC (before Christ)?

Yours Jan

Eskha

unread,
Oct 24, 2018, 2:38:48 PM10/24/18
to TiddlyWiki
Hi Jan,

Hoping this may still help you for your second point: I use "Y" format for date and a "-" in front of the date (eg -200 for 200 BC).

Good luck with your course.

Eskha

Jan

unread,
Aug 23, 2020, 10:15:02 AM8/23/20
to tiddl...@googlegroups.com
Hello everyone, hello Eskha in particular...,

Two years ago
I asked two questions about the vis.js-timeline

-Could we get the plugin to parse more than one date format? For example in my usecase there is exact dates and timespans where exact dates are not appropriate (Like the Renaissance or so)
-How can I enter dates BC (before Christ)?
I just searched my inbox and I found your hint which has slipped through my attention. Thanks a lot, this works!

Am 24.10.2018 um 20:38 schrieb Eskha:

Hoping this may still help you for your second point: I use "Y" format for date and a "-" in front of the date (eg -200 for 200 BC

This already helps a great deal, but I still would like to parse / enter different date-formats to the plugin. I ask myself, whether i could replace moments.js which is can render hundrets of formats by something smaller and more tolerant to enter the dates.  Can anyone say how the date is transferred from the moments.js-widget to the timeline?

More tolerant means that it would replace 1789-07-14  by 1789 vice versa without causing an error.

Best wishes
Jan




TW Tones

unread,
Aug 23, 2020, 10:39:56 PM8/23/20
to TiddlyWiki
Jan,

Evans formulae plugin has a rich set of date tools but I do not know it it would be any lighter.

As long as you take dates back to a format you can make use of, such as the tiddlywiki serial number or say 0YYYY0MM0DD0MM its fairly easy to parse and reformat date strings now.
Dates before 1900 may be best handled seperately.

What are the formats you would like to move between?

You could have a reference date then treat dates (numbers) before or after a particular date differently eg <1 BC <-100,000 in epochs

Regards
Tony

TW Tones

unread,
Aug 23, 2020, 10:46:37 PM8/23/20
to TiddlyWiki
Jan,

I see you had an example
1789-07-14

Quick example
\define indate() 1789-07-14
{{{ [<indate>split[-]join[]] }}}


gives 17890714

But try 
\define indate() 1789-07-14

{{{ [<indate>split[]!match[-]] }}}

{{{ [<indate>split[]!match[-]join[]] }}}


So a lot can now be done with raw wiki-text although you will often find you need a button to trigger saving a field etc...

Regards
Tony

On Monday, 24 August 2020 00:15:02 UTC+10, Jan wrote:
Reply all
Reply to author
Forward
0 new messages