- Posts: 6
COMMUNITY FORUM
[SOLVED] Extra Fields Formatting Issue...
- daniel nethery
-
Topic Author
- Offline
- New Member
<?php echo JHtml::date($item->extraFields->EventStartDate->value , 'Ymd');?>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- daniel nethery
-
Topic Author
- Offline
- New Member
- Posts: 6
Thanks for the fast reply!
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
<?php echo JHtml::date($this->item->extraFields->EventStartDate->value , 'Ymd');?>
It starts with $this not $item
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I tried
<?php echo JHtml::date($this->item->extraFields->datef->value , 'Y m d');?>
in item.php and it seemed to work fine under Joomla! 3.2 / K2 2.6.8 (Dev Build)
Please Log in or Create an account to join the conversation.
- daniel nethery
-
Topic Author
- Offline
- New Member
- Posts: 6
Wrong ->
$item->extraFields->EventStartDate->value
$this->item->extraFields->EventStartDate->value
Thanks guys for the fast help!
Please Log in or Create an account to join the conversation.
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
You're right, the code should be:
getk2.org/community/English-K2-Community/170475-FIXED-DateTime__construct-datetime--construct-#184729
But still the same error, the part of: administrator\components\com_k2\views\item\view.html.php I think it have changed in some release...
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Since you are using a custom format you don't need to use the JText. So the code will be like that:
<?php echo JHTML::_('date', $this->item->extraFields->fechainicio->value , 'Y-m-d'); ?>
Ensure that you are using a valid format that PHP can handle www.php.net/manual/en/datetime.formats.date.php .
Please Log in or Create an account to join the conversation.
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- Alfonso F. Moreno
-
- Offline
- Elite Member
- Posts: 169
I don´t Know why it works if I do a language override of K2_DATE_FORMAT_LC with "Y-m-d" and create one new override K2_DATE_FORMAT_LC3 with "l, d F Y". Then, I change PHP to:
Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.