The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Customizing the calendar?

3 posters

Go down

Customizing the calendar? Empty Customizing the calendar?

Post by Zeta April 25th 2018, 6:53 am

How would I go about customizing the month and day names in the standard forumotion calendar? I want it to have the month and day names of the rp setting at my forum, but I can't find the month and day names in the calendar templates. Where do I change this? Can I even change this?
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by skouliki April 25th 2018, 7:43 am

hello 

You can read this tutorial https://help.forumotion.com/t1449-the calendar

you can use our new system that is way better and faster https://help.forumotion.com/t153199-new-functionality-the-events
skouliki
skouliki
Manager
Manager

Female Posts : 15378
Reputation : 1708
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Zeta April 25th 2018, 8:03 am

skouliki wrote:hello 

You can read this tutorial https://help.forumotion.com/t1449-the calendar

you can use our new system that is way better and faster https://help.forumotion.com/t153199-new-functionality-the-events

I've already read the calendar tutorial and it doesn't answer my question. Neither does the events information. I want to know how to change the names of the months and dates. Where it says things like "January", "February", "Saturday" or "Thursday" I want it to say something different.


Last edited by Zeta on April 25th 2018, 8:04 am; edited 1 time in total (Reason for editing : spelling)
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by skouliki April 25th 2018, 8:14 am

can you provide please your forum url ? iam not quite sure if that is possible
maybe by modifying the calendar template
skouliki
skouliki
Manager
Manager

Female Posts : 15378
Reputation : 1708
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Zeta April 25th 2018, 9:40 am

skouliki wrote:can you provide please your forum url ? iam not quite sure if that is possible
maybe by modifying the calendar template

I've already looked at the templates in the calendar section and stated in my first post that I could not find the month and day names there to alter. I am open to a javascript or html solution to this if anybody can present one. Or if somebody else already knows where to look I would appreciate being told. The calendar templates appear to be the same regardless of what forum it is.
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Wecoc April 25th 2018, 1:06 pm

You should provide a link to the calendar on your forum and say which names you want to change exactly, bacause there are many options. Also it's different if you are referring to the calendar widget, the calendar main page or the calendar schedule.

Anyway what you ask can be done with javascript, filtering the elements and changing the names in their 'html' property directly.
Here I tested this one in a PHPBB2 forum to change this names:

Code:
$(function(){
  var days_hash = {
    "Sunday":    "SUN",
    "Monday":    "MON",
    "Tuesday":  "TUES",
    "Wednesday": "WED",
    "Thursday":  "THURS",
    "Friday":    "FRI",
    "Saturday":  "SAT"
  };
  $('table.forumline th').filter(function(){
    var e = $(this), d;
    for (d in days_hash) {
      e.html(e.html().replace(d, days_hash[d]));
    }
  });
});

Customizing the calendar? Calendar_test
Wecoc
Wecoc
Forumember

Male Posts : 144
Reputation : 111
Language : Catalan, Spanish, English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Zeta April 25th 2018, 10:59 pm

Wecoc wrote:You should provide a link to the calendar on your forum and say which names you want to change exactly, bacause there are many options. Also it's different if you are referring to the calendar widget, the calendar main page or the calendar schedule.

Anyway what you ask can be done with javascript, filtering the elements and changing the names in their 'html' property directly.
Here I tested this one in a PHPBB2 forum to change this names:

Code:
$(function(){
  var days_hash = {
    "Sunday":    "SUN",
    "Monday":    "MON",
    "Tuesday":  "TUES",
    "Wednesday": "WED",
    "Thursday":  "THURS",
    "Friday":    "FRI",
    "Saturday":  "SAT"
  };
  $('table.forumline th').filter(function(){
    var e = $(this), d;
    for (d in days_hash) {
      e.html(e.html().replace(d, days_hash[d]));
    }
  });
});

Customizing the calendar? Calendar_test

That seems to work for the days on the calendar page. Thank you. What about the month names though? I would like it changed for the calendar widget, the calendar main page and the calendar schedule. Basically anywhere it would display.
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by skouliki April 26th 2018, 7:37 am

rules wrote: Please provide your forum URL for appearance problems.
skouliki
skouliki
Manager
Manager

Female Posts : 15378
Reputation : 1708
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Zeta April 28th 2018, 8:48 am

Bump
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Wecoc April 28th 2018, 2:14 pm

I would like it changed for the calendar widget, the calendar main page and the calendar schedule. Basically anywhere it would display.
Everywhere calendar would display, or everywhere dates would display?

Well, it's not recommended to edit it everywhere, should be better to do it case by case.
That way will take less time to process and will avoid problems between full names and abbreviations, or in post contents.
I know dates are displayed many times along the forum but still I would priorizate that.

It's tricky to do, so you should think how much you really need this. Will be easier if it's only in the calendars, of course.
If you want go on with that, search every part where that should be replaced and provide a link in every case (only the forum's main link for widgets).
I understand you don't want to share your forum link here but you should be able to remove it when this is solved anyway, in case this helps...
Wecoc
Wecoc
Forumember

Male Posts : 144
Reputation : 111
Language : Catalan, Spanish, English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Zeta April 28th 2018, 11:44 pm

Wecoc wrote:
I would like it changed for the calendar widget, the calendar main page and the calendar schedule. Basically anywhere it would display.
Everywhere calendar would display, or everywhere dates would display?

Well, it's not recommended to edit it everywhere, should be better to do it case by case.
That way will take less time to process and will avoid problems between full names and abbreviations, or in post contents.
I know dates are displayed many times along the forum but still I would priorizate that.

It's tricky to do, so you should think how much you really need this. Will be easier if it's only in the calendars, of course.
If you want go on with that, search every part where that should be replaced and provide a link in every case (only the forum's main link for widgets).
I understand you don't want to share your forum link here but you should be able to remove it when this is solved anyway, in case this helps...
Just everywhere the calendar would display. The calendar page, the widget, etc. there is nothing in any of these that is not available for all forums.
It wouldn't help if I provided the forum link anyway. Guests can only see the log in page instead of the forum index and widgets on it. Also, removing the link after its been up there for days or weeks won't do much to keep unwanted guests away.
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Wecoc May 12th 2018, 11:41 pm

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;
});

This is the format of the code:
text = text.replace(/\bOld\b/gm, "New");

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");
(...)

If you want it case insensitive, in the same line(s) change /gm to /gmi

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.
Wecoc
Wecoc
Forumember

Male Posts : 144
Reputation : 111
Language : Catalan, Spanish, English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post 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.
Zeta
Zeta
Forumember

Posts : 211
Reputation : 2
Language : English

Back to top Go down

Customizing the calendar? Empty Re: Customizing the calendar?

Post by Wecoc May 14th 2018, 3:25 pm

It's exactly the same, under all the day names edits do the same with months, like this:
Code:
text = text.replace(/\bJanuary\b/gm, "JAN");
text = text.replace(/\bFebruary\b/gm, "FEB");
text = text.replace(/\bMarch\b/gm, "MAR");
Etcetera.

Hope it works Wink
Wecoc
Wecoc
Forumember

Male Posts : 144
Reputation : 111
Language : Catalan, Spanish, English

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum