Dates, moment.js and Gantt charts via vis.js timeline

263 views
Skip to first unread message

Ste Wilson

unread,
Sep 10, 2019, 10:03:00 AM9/10/19
to TiddlyWiki
Just a quick cry for help...back to work and back to reading here more regularly..

I thought it would be a good thing if I could put my (and eventually, my colleagues) assessment schedules with links to the alleviate bits of the awarding bodies spec and a snippet of the associated assignment with working times and deadline and hols on etc all into the amazement that we know and love as 'The Tiddlywiki Platform'.

So first question..
Does anyone else have experiance using vis.js timeline plugin?
(kixam.github.io/TW5-vsjsTimeline/)

Q2

I've set up teaching weeks.. A tiddler per week. Can I do anything clever (well obviously i can't.. But can it be done) where the date for the next week is taken from the date of last week +7 for example?
Start and end dates are stored as fields in each tiddler.

Q3
The default behaviour seems to be that something ends at the start of the date. I'd like it to end at the end thus colouring in the full day on the time line.
I've started to get round this by putting a time of 24:00 in the end dates...

Q4

If I have an end time of 27th Feb 2020 16:30 in a field is it possible to just show up to the year in the tiddler and chop off the time?

Q5
Tbc...

Wip can be found

http://stephenteacher.updog.co/Assesment%20Schedule.html

Cheers


Ste Wilson

unread,
Sep 10, 2019, 10:12:43 AM9/10/19
to TiddlyWiki
5.
Did someone do a nice date drop down selector thing once?

Ste Wilson

unread,
Sep 10, 2019, 11:20:16 AM9/10/19
to TiddlyWiki
Pps it's not a phishing site and works of you copy and paste the link but not if you click on it....

TonyM

unread,
Sep 10, 2019, 6:38:00 PM9/10/19
to TiddlyWiki
Ste,

Welcome back, Its being a little quiet recently with the northern hemisphere on holiday. But still lost of progress in the tiddlyverse.

Here is a quick brain dump, but dates can get complex so continue asking questions. I have done a lot with dates and have some nice code patterns up my sleeve. There are a lot of changes in 5.1.20 that will help with dates I have not yet made use of. But the implementation you are using has date manipulation features.

Q1 Link broken
I did in the past, it was quite good

Q2 date ranges
When possible I suggest storing enough only, the start date of each fortnight can be used to get its end date. In fact I would look at using week numbers rather than date ranges and the day of week can help you extract beginning of week. The days operator can be used to get + 7 days, just change the fieldname it applies to. Where ever possible there is value calculating the dates as needed rather hard coding them. Of course the timeline plugin demands the dates to be set but can you make the result be calculated on the fly?

Q3 Try a date of YYYY0MM0DD only in your date field and see how that responds
The fact is that using a time on 00:00 or 23:59/24:00 makes sense when date fields include time and you want to select whole days. But experience shows in many cases simply leaving the time off the end results in the desired result. 

Q4 Where is this happening? Do you mean the subtitle?

Q5 Did someone do a nice date drop down selector thing once?

Keep the conversation going

Regards
Tony

PMario

unread,
Sep 11, 2019, 5:44:08 AM9/11/19
to TiddlyWiki
Hi Ste,

If I click your last link I do get a Phishing warning. ... Are you sure your site isn't compromised?

-m

Ste Wilson

unread,
Sep 11, 2019, 10:58:04 AM9/11/19
to TiddlyWiki
If I click through the warnings its just my regular tiddlywiki.. It's being served from my Dropbox which I don't think is hacked.. No clue.

Ste Wilson

unread,
Sep 11, 2019, 11:04:25 AM9/11/19
to TiddlyWiki
Date question...

If I have a tiddler with the field start and I put a date in it how in the same tiddler can I pass that value into another field and do a moment in it.. moment({{!!start}}).add(7, days) does not parse in the time line...

Ste Wilson

unread,
Sep 11, 2019, 11:29:40 AM9/11/19
to TiddlyWiki

TonyM

unread,
Sep 11, 2019, 8:28:39 PM9/11/19
to TiddlyWiki
Ste,

Your use of moment is in java script yes?, You can effectively determine the second date (or provide a relative date) in Wiki text using a filter and the days operator, although it does not spit out the second date you can select tiddlers with the same date as the first + - or equal to the first date.

Regards
Tony

TonyM

unread,
Sep 11, 2019, 8:37:19 PM9/11/19
to TiddlyWiki
Ste,

On your week 16, I added a caption of "16th Week" which is much nicer than seeing lots of "W" on the time line.

Thinking about your initial post, I wonder if the timeline will respond to a computed field eg
start:  Standard date
End: `{{{ [is[current]days:start[+6]] }}}` should return the last day of the week in end field if transcluded.

  • Above untested
  • May not work with timeline
Regards
Tony

Ste Wilson

unread,
Sep 12, 2019, 1:22:05 PM9/12/19
to TiddlyWiki
That's a good shout on the numbering. I'll dig into the dates thing next week. What I've got is I guess good enough for the moment but definetly want to make it more tubular so I can reuse it easily next year or just do more with dates.

Mohammad

unread,
Apr 12, 2020, 10:04:37 AM4/12/20
to TiddlyWiki
Hi Ste,


On Wednesday, September 11, 2019 at 7:59:40 PM UTC+4:30, Ste Wilson wrote:
A non toxic version at http://stephenteachertests.tiddlyspot.com/

 have you used moment.js plugin? what is your recommendation?

--Mohammad 

Ste Wilson

unread,
Apr 12, 2020, 4:14:45 PM4/12/20
to TiddlyWiki
Hi Mo,
Now your asking... :)
I don't think I delved into the js too deeply. I didn't really follow things much further than you can see in http://stephenteachertests.tiddlyspot.com/#Assessment%20Schedule as due to, apparently, the IT dept not being able to set chrome/ ff as the default browser (don't ask) the students never used it as explorer shows a red screen of embarrassment... So I never followed through on linking weeks through to resources/ assignments etc. Sorry I can't shed more light.

Mohammad

unread,
Apr 13, 2020, 1:22:48 AM4/13/20
to TiddlyWiki
Thank Ste,
 So, it seems I should learn JS and do it :-)
--Mohammad

Ste Wilson

unread,
Apr 13, 2020, 3:59:26 AM4/13/20
to TiddlyWiki
I keep thinking the same.. Learn some js.. Just finding the time. Best of luck!
Reply all
Reply to author
Forward
0 new messages