by Zeta May 14th 2018, 7:10 am
[quote="Wecoc"]Are you still interested in this? It has been awhile, sorry but I'm busy lately.
Well, this code is a bit crazy but it's all I can do to provide what you are asking here.
[code]$(function(){
var body = document.querySelector('body'), text = body.innerHTML;
text = text.replace(/\bMonday\b/gm, "MON");
body.innerHTML = text;
});[/code]
This is the format of the code:
text = text.replace(/\b[b][color=#006600]Old[/color][/b]\b/gm, "[b][color=#FF9933]New[/color][/b]");
Because you want it also for the other week days and maybe abbreviations of the days, months, etc. all you have to do is copy that line and paste it right under it, and use it again with the new text to be replaced.
You can do that as many times as you want.
[code]text = text.replace(/\bMonday\b/gm, "MON");
text = text.replace(/\bTuesday\b/gm, "TUES");
text = text.replace(/\bWednesday\b/gm, "WED");
(...)[/code]
If you want it case insensitive, in the same line(s) change [color=#FF0000]/gm[/color] to [color=#FF0000]/gmi[/color]
As I said I was trying to avoid something like this because it will change the text absolutely everywhere, also in posts if somebody writes "Monday", for example. But I guess it's the only way to solve this in your case.[/quote]
Thank you. What about Months though? January, February, etc. I've been asking for those the whole time too.