help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
[SOLVED]Date format in calendar
Date format in calendar
1 month 3 weeks ago
Hey!
I would like to change the date format from month+year to year+month in the calendar. I found no option for that in the settings (or i'm just blind).
I would like to change the date format from month+year to year+month in the calendar. I found no option for that in the settings (or i'm just blind).
Please Log in or Create an account to join the conversation.
Re: Date format in calendar
1 month 3 weeks ago
Hi Llondwel, create an template override from mod_jem_cal (do you know how to do it?).
Then in your template folder in the folders html > mod_jem_cal in the file default.php you change the line 79 from:
to
That should do it.
Then in your template folder in the folders html > mod_jem_cal in the file default.php you change the line 79 from:
Code:
$title = $the_month . ' ' . $the_year;
Code:
$title = $the_year . ' ' . $the_month;
The following user(s) said Thank You: Llondwel
Please Log in or Create an account to join the conversation.
Re: Date format in calendar
1 month 3 weeks ago - 1 month 3 weeks ago
This changed the little cal module's title, but not the big one. I need this for the component, not the module. (Ok, i needed it for the module too)
postimg[dot]cc/RqJGMx8X
postimg[dot]cc/RqJGMx8X
Last edit: 1 month 3 weeks ago by Llondwel.
Please Log in or Create an account to join the conversation.
Re: Date format in calendar
1 month 3 weeks ago - 1 month 3 weeks ago
There are many places with dates – where exactly is the one you are talking about?
Last edit: 1 month 3 weeks ago by hekla.
Please Log in or Create an account to join the conversation.
Re: Date format in calendar
1 month 3 weeks ago
In the large calendar this is only possible with a core hack, which you loose after each update (= you have to redo it each time)
in the file /components/com_jem/classes/calendar.class.php on line 519 change:
to
in the file /components/com_jem/classes/calendar.class.php on line 519 change:
Code:
$out .= $this->getMonthName().$this->monthYearDivider.$this->actyear."";
Code:
$out .= $this->actyear.$this->monthYearDivider.$this->getMonthName()."";
The following user(s) said Thank You: Llondwel
Please Log in or Create an account to join the conversation.
Re: Date format in calendar
1 month 3 weeks ago - 1 month 3 weeks ago
Or you use javascript:
Code:
// Specifically target the td.monthname element within div.jem_calendar and table.month
const monthname = document.querySelector('.jem_calendar table.month td.monthname');
// If the element was found
if (monthname) {
// Extract and split the text
const text = monthname.innerText;
const parts = text.split(' ');
// If the format is correct (month year)
if (parts.length === 2) {
// Swap the parts and join them back together
monthname.innerText = `${parts[1]} ${parts[0]}`;
}
}
Last edit: 1 month 3 weeks ago by hekla.
Please Log in or Create an account to join the conversation.
Time to create page: 0.483 seconds