From 0a6f25737d4f2962d262a1f03c0f84a200eb5d46 Mon Sep 17 00:00:00 2001
From: Ivo Silva
To set a locale for the timeline, specify the option
{locale: STRING}
.
To set the scale to use week numbers, use for example {scale: 'week', step: 1}
.
+ To set the scale to use week numbers, use the following options:
+
+ {
+ timeAxis: {
+ scale: 'week',
+ step: 1
+ },
+ format: {
+ minorLabels: {week: 'w'}
+ }
+ }
+
+
The following timeline is initialized with the 'de' locale and items are added with locally localized moment.js objects. The timeline locale can be switched to another locale at runtime. If you choose the 'en' locale, the week numbers will be calculated according to the US week calendar numbering scheme.
@@ -93,7 +107,16 @@ } // Configuration for the Timeline - var options = {timeAxis: {scale: 'week', step: 1}, locale: 'de'}; + var options = { + locale: 'de', + timeAxis: { + scale: 'week', + step: 1 + }, + format: { + minorLabels: {week: 'w'} + } + }; // Create a Timeline var timeline = new vis.Timeline(container, items, groups, options); @@ -108,4 +131,4 @@ select.onchange();