From f5c42b83b3720b3b28cdfe5cdfd41e2d8d25f938 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();