Results 1 to 5 of 5

Thread: date display in event_upcoming

  1. #1
    User
    Join Date
    08-04-09.
    Posts
    230

    Default date display in event_upcoming

    Hello everybody,

    I want to use the event_upcoming as an event list.

    In my event item I have not filled out an end date or time. Only start date.
    It does display a double date notation however.

    for example:
    28-09-2009 - 28-09-2009 Clinic

    How can I make it:
    28-09-2009 Clinic

    Event_upcoming.tpl:
    Code:
    <div class="event<?php echo $this->class; ?>">
    <span class="date"><?php echo $this->date; ?></span>
    title; ?> (<?php if ($this->day): echo $this->day; ?>, <?php endif; echo $this->date; if ($this->time): ?><?php echo $this->time; endif;?>)"<?php echo $this->target; ?>><?php echo $this->title; ?>
    <?php if ($this->time): ?>
    <span class="time">(<?php echo $this->time; ?>)</span>
    <?php endif; ?>
    </div>

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: date display in event_upcoming

    Hi,

    The gist of it is, where you see:

    Code:
    <span class="date"><?php echo $this->date; ?></span>
    replace with:

    Code:
    <span class="date"><?php echo $this->firstDate; ?></span>
    I believe this will show what you want, regardless of whether you have an end date or a time filled out.

    - B
    Brian

  3. #3
    User
    Join Date
    08-04-09.
    Posts
    230

    Default Re: date display in event_upcoming

    Thanks.
    I really thought that would do the trick. But no....
    It makes the date dissapear completely.

    Also tried dateBegin, but that does not work either....

  4. #4
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: date display in event_upcoming

    Hmm, I had it working on my end... Doublecheck that your code matches, including capitalization, etc. Also try typing it by hand if you cut and pasted the first time (just to replace "date" with "firstDate" in the code where you want the date to appear).

    Someone else may know more, including why it doesn't work for you, but in the meantime you can try another workaround in case you are stuck. Instead of what I gave you originally, replace the code with this:

    Code:
    <?php echo date("m-d-Y", $this->startDate); ?>
    This time, we are getting the date as a time stamp, which requires a bit more work to format the way you want, so we have to run it through a "date()" function, passing it the format we want ("m-d-Y").

    Again, I would try to retype this instead of copying and pasting -- I hear it can cause problems sometimes on this forum.
    Brian

  5. #5
    User
    Join Date
    08-04-09.
    Posts
    230

    Default Re: date display in event_upcoming

    That works perfectly for me! Thanks heaps!!

    (I also tried typing the first lines instead of copying / pasting, but that did not work either. )

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •