I am creating a K2 based Event display. At my category view I would like to display the date for the event, taken from an extra field.
<?php echo $this->item->extraFields->Start->value;?>
To this point I am successful. Next I need to change the date format, to "j M Y". Also, for the intended display, I would like to separate "j" "M" and "Y" so I can style them individually. The idea is to have three div's each output a single piece of the date. The final look will be a big date that displays beside each event. See below.
1
Jan
2013
So I used the following code:
<div class="day"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "j"); ?></div>
<div class="month"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "M"); ?></div>
<div class="year"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "Y"); ?></div>
This works, but with the following issue. The date displays a day earlier than the actual Extra Field date. When i use just this code:
<?php echo $this->item->extraFields->Start->value;?>
The output is correct, however not in the correct date format. This leads me to believe there is an issue when attempting to modify the date format in my code.
Is anyone aware of any possible sources for this issue? How can I resolve this issue or accomplish my main task?
Any help would be greatly appreciated.
<?php echo $this->item->extraFields->Start->value;?>
To this point I am successful. Next I need to change the date format, to "j M Y". Also, for the intended display, I would like to separate "j" "M" and "Y" so I can style them individually. The idea is to have three div's each output a single piece of the date. The final look will be a big date that displays beside each event. See below.
1
Jan
2013
So I used the following code:
<div class="day"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "j"); ?></div>
<div class="month"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "M"); ?></div>
<div class="year"><?php echo JHTML::_('date', $this->item->extraFields->Start->value, "Y"); ?></div>
This works, but with the following issue. The date displays a day earlier than the actual Extra Field date. When i use just this code:
<?php echo $this->item->extraFields->Start->value;?>
The output is correct, however not in the correct date format. This leads me to believe there is an issue when attempting to modify the date format in my code.
Is anyone aware of any possible sources for this issue? How can I resolve this issue or accomplish my main task?
Any help would be greatly appreciated.