I am using the vis.js timeline for a project and tried to add a custom locale as explained in the documentation.
var options = {
locales: {
// create a new locale (text strings should be replaced with localized strings)
mylocale: {
current: 'current',
time: 'time',
}
},
// use the new locale
locale: 'mylocale'
};
Although I'd like to make it work without moment.js I loaded moment.js before vis.js. Here is an example on jsfiddle that I expected to work but it doesn't. Can somebody please explain why it doesn't work as documented or if I missed something important?
You can simply set your options:
But you need to add:
See https://visjs.github.io/vis-timeline/examples/timeline/other/localization.html for example.