Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Commit

Permalink
Update week scale example
Browse files Browse the repository at this point in the history
  • Loading branch information
knokit committed Oct 11, 2017
1 parent 457cfd7 commit 6339364
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions examples/timeline/styling/weekStyling.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@
of moment.js including locales.</p>
<p>To set a locale for the timeline, specify the option
<code>{locale: STRING}</code>.</p>
<p>To set the scale to use week numbers, use for example <code>{scale: 'week', step: 1}</code>.</p>
<p>
To set the scale to use week numbers, use the following options:
<code>
{
timeAxis: {
scale: 'week',
step: 1
},
format: {
minorLabels: {week: 'w'}
}
}
</code>
</p>

<p>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.</p>
Expand Down Expand Up @@ -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);
Expand All @@ -108,4 +131,4 @@
select.onchange();
</script>
</body>
</html>
</html>

0 comments on commit 6339364

Please sign in to comment.