I just realized that this bit:
Code:
var days=['lundi','mardi','mercredi','jeudi','vendredi','samedi','dimanche']
var Days=['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche']
var months=['lundi','mardi','mercredi','jeudi','vendredi','samedi','dimanche','janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre']
var Months=['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche','Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre']
for (i_tem = 0; i_tem < days.length; i_tem++){
var re=new RegExp(days[i_tem],'g')
theHTML=theHTML.replace(re, Days[i_tem])
}
for (i_tem = 0; i_tem < months.length; i_tem++){
var re2=new RegExp(months[i_tem],'g')
theHTML=theHTML.replace(re2, Months[i_tem])
}
Could be condensed to:
Code:
var dm=['lundi','mardi','mercredi','jeudi','vendredi','samedi','dimanche','janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre']
var DM=['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche','Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre']
for (i_tem = 0; i_tem < dm.length; i_tem++){
var re=new RegExp(dm[i_tem],'g')
theHTML=theHTML.replace(re, DM[i_tem])
}
There are probably other efficiencies that could be made. Also, this whole set up perhaps gives you more control over the style than you need but, you never know what you might want to change. Virtually all of the style is now in the stylesheet. If they decide to change the general layout of the output for this service, changes may be required in the code I've written but, I think I've followed the current layout closely enough that it should work with every day of the year, as currently laid out.
BTW, do you know of any English language equivalent of this service?
Bookmarks