- Posts: 36
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
- Andrew Paterson
- Topic Author
- Offline
- Junior Member
Less
More
6 years 1 month ago #169628
by Andrew Paterson
Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9. was created by Andrew Paterson
After updating Joomla to 3.8.13, the dates in all K2 content modules, K2 category items and K2 items are not being formatted correctly.
K2 version is and K2 2.9.
They look like this: %AM, %14 %315 %2018. where they have been working fine before.
This is the template code I'm using for mod_content for example:
This is in my current en-GB.com_k2.ini file:
The problem occurs whent he PHP version is either 5.6 or 7.0.
K2 version is and K2 2.9.
They look like this: %AM, %14 %315 %2018. where they have been working fine before.
This is the template code I'm using for mod_content for example:
<?php if($params->get('itemDateCreated')): ?>
<span class="moduleItemDateCreated"> <?php echo JHTML::_('date', $item->created, JText::_('K2_DATE_FORMAT_LC')); ?></span>
<?php endif; ?>
This is in my current en-GB.com_k2.ini file:
K2_DATE_FORMAT="%d/%m/%Y - %H:%M"
K2_DATE_FORMAT_LC2="%A, %d %B %Y %H:%M"
K2_DATE_FORMAT_LC="%A, %d %B %Y"
The problem occurs whent he PHP version is either 5.6 or 7.0.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
6 years 1 month ago #169643
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
mod_k2_content loads its own language file from /language/en-GB/en-GB.mod_k2_content.ini - make sure nothing else is overriding K2's language strings for date definitions (it could be an override placed in the Joomla backend for example).
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Andrew Paterson
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
6 years 1 month ago #169677
by Andrew Paterson
Replied by Andrew Paterson on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Thank you.
The formatting issue is happening with all K2 templates- category list items, full items and items in the K2 content module. I tried pasting the date format string directly into the template as below.
The date looks like this on the frontend:
%AM, %26 %343 %2016 %09:%Sep
I tried with the default K2 date format:
The date appears like this:
%26/%09/%2016 - %09:%Sep
If I remove the date format altogether, I get what I assume is the default Joomla date format.
Monday, 26 September 2016
Do you think the above could still be caused by an override of a K2 language file?
The formatting issue is happening with all K2 templates- category list items, full items and items in the K2 content module. I tried pasting the date format string directly into the template as below.
<span class="catItemDateCreated"> <?php echo JHTML::_('date', $this->item->publish_up , "%A, %d %B %Y %H:%M"); ?> </span>
The date looks like this on the frontend:
%AM, %26 %343 %2016 %09:%Sep
I tried with the default K2 date format:
<span class="catItemDateCreated"> <?php echo JHTML::_('date', $this->item->publish_up , "%d/%m/%Y - %H:%M"); ?> </span>
The date appears like this:
%26/%09/%2016 - %09:%Sep
If I remove the date format altogether, I get what I assume is the default Joomla date format.
<span class="catItemDateCreated"> <?php echo JHTML::_('date', $this->item->publish_up); ?> </span>
Monday, 26 September 2016
Do you think the above could still be caused by an override of a K2 language file?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
6 years 1 month ago #169686
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
I literally have no idea. It's the first time anyone reports something like that. It could be a broken override or even a system plugin.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Florian
- Offline
- New Member
Less
More
- Posts: 2
6 years 1 month ago #169790
by Florian
Replied by Florian on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Hi All,
Just to mention I'm facing the same issue. It occurs on frontend but not on backend where I can see date displaying correctly.
Joomla 3.8.13 / PHP 7.2
Just to mention I'm facing the same issue. It occurs on frontend but not on backend where I can see date displaying correctly.
Joomla 3.8.13 / PHP 7.2
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
6 years 1 month ago #169796
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
@Andrew
Change the code to:
In other words don't use % and refer to php.net/manual/en/function.date.php for date formatting.
@Florian
Can you try the above solution as well and let me know if it works please?
Change the code to:
<span class="catItemDateCreated">
<?php echo JHTML::_('date', $this->item->publish_up , "d/m/Y - H:i"); ?>
</span>
In other words don't use % and refer to php.net/manual/en/function.date.php for date formatting.
@Florian
Can you try the above solution as well and let me know if it works please?
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Florian
- Offline
- New Member
Less
More
- Posts: 2
6 years 1 month ago - 6 years 1 month ago #169805
by Florian
Replied by Florian on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Hi Fotis,
Thanks for your support. I've made the change and it is working fine.
For your information, the original code was :
Any clue why it stops displaying correctly ?
Update: i'm using french language file (fr-FR.com_k2.ini version 2.7.x) and variable K2_DATE_FORMAT_LC2 has value "%A, %d %B %Y %H:%M".
Thanks for your support. I've made the change and it is working fine.
For your information, the original code was :
<span class="itemDateCreated"> <?php echo JHTML::_('date', $this->item->created, JText::_('K2_DATE_FORMAT_LC2')); ?>
Any clue why it stops displaying correctly ?
Update: i'm using french language file (fr-FR.com_k2.ini version 2.7.x) and variable K2_DATE_FORMAT_LC2 has value "%A, %d %B %Y %H:%M".
Last edit: 6 years 1 month ago by Florian. Reason: add details
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
6 years 1 month ago #169814
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
I couldn't replicate the issue. Did you also check that there is no direct override from the language overrides section in Joomla's backend?
Out of curiosity, what PHP version are you using?
Out of curiosity, what PHP version are you using?
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Andrew Paterson
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
6 years 1 month ago #169817
by Andrew Paterson
Replied by Andrew Paterson on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Thank you, this works for me.
I really appreciate your help.
I really appreciate your help.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
6 years 1 month ago #169818
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.
Good to know Andrew.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Dates not displaying correctly after update to Joomla 3.8.13 and K2 2.9.