Keyword

[SOLVED] Extra Fields Formatting Issue...

  • daniel nethery
  • daniel nethery's Avatar Topic Author
  • Offline
  • New Member
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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122030 by Krikor Boghossian
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
  • daniel nethery's Avatar Topic Author
  • Offline
  • New Member
More
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!

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 9 months ago #122032 by Mohamed Abdelaziz
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:
<?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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122033 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Extra Fields Formatting Issue...
Where is this happening in your template?

I tried
<?php echo JHtml::date($this->item->extraFields->datef->value , 'Y m d');?>
i

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
  • daniel nethery's Avatar Topic Author
  • Offline
  • New Member
More
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 ->
$item->extraFields->EventStartDate->value
Right ->
$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
  • Alfonso F. Moreno's Avatar
  • Offline
  • Elite Member
More
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
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 6 months ago #122036 by Mohamed Abdelaziz
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
  • Alfonso F. Moreno's Avatar
  • Offline
  • Elite Member
More
10 years 6 months ago #122037 by Alfonso F. Moreno
Replied by Alfonso F. Moreno on topic Re: [SOLVED] Extra Fields Formatting Issue...
Unfortunately no...

Code is:
Log in  or Create an account to join the conversation.

  • Alfonso F. Moreno
  • Alfonso F. Moreno's Avatar
  • Offline
  • Elite Member
More
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:
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.