Timeline DayLabel

From SIMILE Widgets
Jump to: navigation, search

Adding a day label with your month when your interval unit is days

I'll make a french example since I'm a french-speaking guy ;)

  • Create a fr folder in the l10n folder
  • Create a new labellers.js in the fr folder
  • add the following in the js file:
 Timeline.GregorianDateLabeller.dayNames["fr"] = ["lun", "mar", "mer", "jeu", "ven", "sam", "dim"];
  • Go to the script folder
  • Open up labellers.js and add the following function under the getMonthName function at the beginning of the file (near line 15)
Timeline.GregorianDateLabeller.getDayName = function(day, locale){return Timeline.GregorianDateLabeller.dayNames[locale][day];}
  • find the defaultLabelInterval function in the labellers.js file and modify the Timeline.DateTime.DAY case in the switch ┬áto the following:
text = Timeline.GregorianDateLabeller.getDayName( date.getDay() , this._locale) + ", " + Timeline.GregorianDateLabeller.getMonthName(date.getUTCMonth(), this._locale) + " " + date.getUTCDate();

Here's what it looks like:

Day label.jpg

Personal tools