From 9249fb7384e4a55742632a374d16231dd9098c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Kr=C3=A4mer?= Date: Thu, 11 Aug 2016 15:09:40 +0200 Subject: [PATCH 1/3] #2014 --- lib/timeline/TimeStep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index 1d0afd12..1e5fc5a4 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -610,7 +610,7 @@ TimeStep.prototype.getClassName = function() { case 'day': var day = current.date(); var month = current.format('MMMM').toLowerCase(); - return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1); + return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1) + today(current) +' vis-' + current.format('dddd').toLowerCase();; case 'month': return 'vis-' + current.format('MMMM').toLowerCase() + From 539afa75e7fad1a4ebfb766e8691c7acd7624ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Kr=C3=A4mer?= Date: Thu, 11 Aug 2016 15:21:18 +0200 Subject: [PATCH 2/3] #2014, changed visible to 2 day limit in zoom --- lib/timeline/TimeStep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index 1e5fc5a4..f01aaefc 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -610,7 +610,7 @@ TimeStep.prototype.getClassName = function() { case 'day': var day = current.date(); var month = current.format('MMMM').toLowerCase(); - return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1) + today(current) +' vis-' + current.format('dddd').toLowerCase();; + return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1) + (this.step <= 2 ? today(current) +' vis-' + current.format('dddd').toLowerCase() : ''); case 'month': return 'vis-' + current.format('MMMM').toLowerCase() + From 29f2d98d304da64d71ea0f4eb5706cc58098c5a9 Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Sun, 14 Aug 2016 23:35:31 +0200 Subject: [PATCH 3/3] timeline: set weekday css class on high zoom levels; fixes #2014; code cleanup; --- lib/timeline/TimeStep.js | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index f01aaefc..c5a9bfc2 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -588,37 +588,47 @@ TimeStep.prototype.getClassName = function() { switch (this.scale) { case 'millisecond': - return even(current.milliseconds()).trim(); + return today(current) + + even(current.milliseconds()).trim(); case 'second': - return even(current.seconds()).trim(); + return today(current) + + even(current.seconds()).trim(); case 'minute': - return even(current.minutes()).trim(); + return today(current) + + even(current.minutes()).trim(); case 'hour': - var hours = current.hours(); - if (this.step == 4) { - hours = hours + '-h' + (hours + 4); - } - return 'vis-h' + hours + today(current) + even(current.hours()); + return 'vis-h' + current.hours() + (this.step == 4 ? '-h' + (current.hours() + 4) : '') + + today(current) + + even(current.hours()); case 'weekday': return 'vis-' + current.format('dddd').toLowerCase() + - today(current) + currentWeek(current) + even(current.date()); + today(current) + + currentWeek(current) + + even(current.date()); case 'day': - var day = current.date(); - var month = current.format('MMMM').toLowerCase(); - return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1) + (this.step <= 2 ? today(current) +' vis-' + current.format('dddd').toLowerCase() : ''); + return 'vis-day' + current.date() + + ' vis-' + current.format('MMMM').toLowerCase() + + today(current) + + currentMonth(current) + + this.step <= 2 ? today(current) : '' + + this.step <= 2 ? ' vis-' + current.format('dddd').toLowerCase() : '' + + even(current.date() - 1); case 'month': return 'vis-' + current.format('MMMM').toLowerCase() + - currentMonth(current) + even(current.month()); + currentMonth(current) + + even(current.month()); case 'year': var year = current.year(); - return 'vis-year' + year + currentYear(current)+ even(year); + return 'vis-year' + year + + currentYear(current) + + even(year); default: return '';