diff --git a/examples/timeline/styling/weekStyling.html b/examples/timeline/styling/weekStyling.html index 9a3a919e5..53663ac0c 100644 --- a/examples/timeline/styling/weekStyling.html +++ b/examples/timeline/styling/weekStyling.html @@ -26,7 +26,21 @@ of moment.js including locales.
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();