Want to remove Month, Day, Year from ccm-calendar-upcoming-date-time in Upcoming view
Permalink Browser Info Environment
I'm re-styling the upcoming view to look more like on eof the views in ChadStrat's Proevents add-on & I'm nearly there, but for this. I've changed the original upcoming.php to this:
and added in some more CSS to make it happen but I can't figure out how to just show the time instead of the Month, Day, Year then Time.
<div class="ccm-calendar-upcoming"> <?php $nh = Loader::helper('navigation'); $counter = 0; $limit = 10; foreach($eventObjList as $ce) { if(strtotime($ce->getEventStartDate()) < time()) { continue; } ?> <div class="ccm-calendar-upcoming-event"> <div class="cal-icon"> <div class="month"> <?php echo date('M', strtotime($ce->getEventStartDate())); ?> </div> <div class="day"> <?php echo date('j', strtotime($ce->getEventStartDate())); ?>
Viewing 15 lines of 32 lines. View entire code block.
and added in some more CSS to make it happen but I can't figure out how to just show the time instead of the Month, Day, Year then Time.
Type: | Discussion |
---|---|
Status: | Archived |
Do you need to use this instead?
$ce->getEventStartDate()
Thanks guys. Wish I could split the Best Answer between you both. Thanks to greg for the correct syntax and to Evan for telling me what to put in to get the start time.
If anyone is interested in restyling their upcoming page to look like this [see attachment] here is the css & the php
///CSS///
///PHP///
If anyone is interested in restyling their upcoming page to look like this [see attachment] here is the css & the php
///CSS///
/* Upcoming View */ .cal-icon { float: left; height: 35px; width: 30px; border: solid thin silver; margin-right: 5px; background-color: white; } .month { background-color: #B70505; color: white; font-size: 10px; font-weight: normal; height: 12px;
Viewing 15 lines of 51 lines. View entire code block.
///PHP///
<div class="ccm-calendar-upcoming"> <?php $nh = Loader::helper('navigation'); $counter = 0; $limit = 10; foreach($eventObjList as $ce) { if(strtotime($ce->getEventStartDate()) < time()) { continue; } ?> <div class="ccm-calendar-upcoming-event"> <div class="cal-icon"> <div class="month"> <?php echo date('M', strtotime($ce->getEventStartDate())); ?> </div> <div class="day"> <?php echo date('j', strtotime($ce->getEventStartDate())); ?>
Viewing 15 lines of 32 lines. View entire code block.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
You can do the same thing where you are echoing the time, except you will want to replace that 'M' with a different string, probably something like
'H:i a', which should show show "hours:minutes am/pm".
Here is the documentation about the PHP date strings:
http://php.net/manual/en/function.date.php...