Welcome, Guest
Username: Password: Remember me

TOPIC:

Change Date Format On Details Page 8 years 1 month ago #16573

  • MyWorld
  • MyWorld's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 3
1) The date on the event details page is showing like this: Jan 30. How can I get it to use the long date, eg: January 30th, 2015? I am using the template override option and the code in that section is this:
<?php
			echo JemOutput::formatLongDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
			echo JemOutput::formatSchemaOrgDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
			?>

2) Also in the backend the date is just showing the month and the day, can that be changed? Please see picture.
Thank you!!
Attachments:
The following user(s) said Thank You: Hoffi

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Change Date Format On Details Page 8 years 1 month ago #16574

The date on the event details page is showing like this: Jan 30. How can I get it to use the long date, eg: January 30th, 2015?

in the backend settings-view you have a setting to fill in a date (short/long) and a time format.
so if you change that then the display of the date will change. The format characters that can be used are mentioned over here . and in the case mentioned above it will be something like
l jS, Y


Also in the backend the date is just showing the month and the day, can that be changed? Please see picture.
Thank you!!

yes it can if you change the date formats mentioned above.

but did see that in the backend we're using a reference to formatLongDateTime but in the front it's a reference to formatShortDateTime and that will give problems. Short should be used for dates in the tables and long was for the event-view.

question:
- what date format do you want to have in the front?
- and what date format for the table in the backend
hmm, think it won't that easy to make it look like the way you want.
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Change Date Format On Details Page 8 years 1 month ago #16581

  • MyWorld
  • MyWorld's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 3
OK so just to clarify:

1) In the table list on the front I would like the date like this: Jan 30, 2015.

2) On the event details page, I would like the long date, the one you referered to above (l jS, Y) January 30th, 2015.

3) In the backend the date is showing like this (Jan 30), without the year, as per the attached. I'm not sure why it is not showing the year?

In my Settings > Format date > I have this (M j, Y).

So do I have to change it directly in the override file in order to have a short date on the table list and long date on the event details page?

Thanks you in advance!

Please Log in or Create an account to join the conversation.

Change Date Format On Details Page 8 years 1 month ago #16583

@MyWorld

to give an answer:
- do you have screenshots about the date settings (backend)

So do I have to change it directly in the override file in order to have a short date on the table list and long date on the event details page?

i would say no..

the overrides will work in the front but the function for the date in the tables are calling
<?php
echo JemOutput::formatShortDateTime($row->dates, $row->times,
$row->enddates, $row->endtimes);
?>
so the date you entered for short should be displayed in the front.


in the backend the date within the events-view is calling
JemOutput::formatLongDateTime($row->dates, null, $row->enddates, null);
this is a different function and is looking at a different setting.


within event-view we're calling
echo JemOutput::formatLongDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtime

so basicly the event-view(front) + date in the events-view (backend) are looking at the setting for the long format.
but as you're pointing out that it doens't display the year i'm wondering what's happening. unfortunately we can't pass a custom format to those functions as that might have been very helpfull

//
hmm, will test it out somewhere this week.
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Change Date Format On Details Page 8 years 1 month ago #16601

  • MyWorld
  • MyWorld's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 73
  • Thank you received: 3
Is this what you are asking for?
Attachments:

Please Log in or Create an account to join the conversation.

Change Date Format On Details Page 8 years 1 month ago #16602

yes that was it,

was wondering how it looked over there..
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

Please Log in or Create an account to join the conversation.

Time to create page: 0.536 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......