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:

<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())); ?>


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.

1 Attachment

Type: Discussion
Status: Archived
PassionForCreative
View Replies: View Best Answer
GregJoyce replied on at Permalink Reply
GregJoyce
See up top in the "month" class and the "day" class divs where it is doing like, date('M',strtotime($ce->someDateFunction()) ?

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...
PassionForCreative replied on at Permalink Reply 1 Attachment
PassionForCreative
Thanks Greg,

Your advice works but it pulls the event Finish time instead of the Start time. Any idea on how to get this the other way around?

<div class="ccm-calendar-upcoming-date-time"> <p><?php   echo date('H:i a', strtotime($ce->getDateString())); ?></p></div>
EvanCooper replied on at Permalink Best Answer Reply
EvanCooper
Do you need to use this instead?
$ce->getEventStartDate()
PassionForCreative replied on at Permalink Reply 1 Attachment
PassionForCreative
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///
/* 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;


///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())); ?>
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
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.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.