- Posts: 6
COMMUNITY FORUM
[SOLVED] Extra Fields Formatting Issue...
- daniel nethery
- Topic Author
- Offline
- New Member
Less
More
10 years 9 months ago #122029
by daniel nethery
[SOLVED] Extra Fields Formatting Issue... was created by daniel nethery
I'm using an Extra Fields type called Date. But when I try to reformat the date, I get a the current date rendered out…
<?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
Less
More
- Posts: 15920
10 years 9 months ago #122030
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Extra Fields Formatting Issue...
Which type of extrfield type are you using, also which version of Joomla! are you using?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- daniel nethery
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 9 months ago #122031
by daniel nethery
Replied by daniel nethery on topic Re: Extra Fields Formatting Issue...
I'm using a Date field (The one with the popup date selector) in Joomla 3.2
Thanks for the fast reply!
Thanks for the fast reply!
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
- Offline
- Platinum Member
- Joomla Developer
10 years 9 months ago #122032
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Re: Extra Fields Formatting Issue...
If you are working in the item view, i.e item.php, then it should be like this:
It starts with $this not $item
<?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
Less
More
- Posts: 15920
10 years 9 months ago #122033
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Extra Fields Formatting Issue...
Where is this happening in your template?
I triedi
in item.php and it seemed to work fine under Joomla! 3.2 / K2 2.6.8 (Dev Build)
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)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- daniel nethery
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 9 months ago #122034
by daniel nethery
Replied by daniel nethery on topic Re: Extra Fields Formatting Issue...
The issue was the how I was calling variable…
Wrong ->Right ->
Thanks guys for the fast help!
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
Less
More
- Posts: 169
10 years 6 months ago #122035
by Alfonso F. Moreno
Replied by Alfonso F. Moreno on topic Re: [SOLVED] Extra Fields Formatting Issue...
This code shows for me the current date in "2014-03-20" format and not the date stored in database. Anybody knows why?????
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
- Offline
- Platinum Member
- Joomla Developer
10 years 6 months ago #122036
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Re: [SOLVED] Extra Fields Formatting Issue...
it will show the current date if the date value is empty or null
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
Less
More
- Posts: 169
10 years 6 months ago #122037
by Alfonso F. Moreno
Replied by Alfonso F. Moreno on topic Re: [SOLVED] Extra Fields Formatting Issue...
- Alfonso F. Moreno
- Offline
- Elite Member
Less
More
- Posts: 169
10 years 6 months ago #122038
by Alfonso F. Moreno
Replied by Alfonso F. Moreno on topic Re: [SOLVED] Extra Fields Formatting Issue...
Sorry....
You're right, the code should be:
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.