• I really love that WP Calendar will automatically not show an end date for one day events, and not show times for all day events. However, this leaves me with hyphen problems. For instance, let’s say this is the template for an event listing:

    <p><strong><a href="{event_url}" title="{event_subject}">{event_subject}</a></strong><br />
    Date(s): {event_startdate} - {event_enddate}<br />
    Time(s): {event_starttime} - {event_endtime}<br />
    Location: {event_location}</p>

    Which outputs something like this:

    My Event
    Date(s): April 1, 2011 – April 2, 2011
    Time(s): 8:00am – 8:00pm
    Location: Conference Center

    Now, let’s say that event is just one day. It outputs like this:

    My Event
    Date(s): April 1, 2011 –
    Time(s): 8:00am – 8:00pm
    Location: Conference Center

    Or, let’s say it’s one day and all day, we get this:

    My Event
    Date(s): April 1, 2011 –
    Time(s): 8:00am –
    Location: Conference Center

    Any ideas how to solve this? Is there a place in the PHP files were I can concatenate a hyphen to the end time/end date?

    Thanks,
    Kim

Viewing 2 replies - 1 through 2 (of 2 total)
  • The problem with the hyphen can be solved easily.

    Date(s): {event_startdate}{event_enddate; before=” – “}

    the tags event_starttime and event_endtime both support a parameter hideifalldayto prevent from printing it. event_time also support the parameter before as seen on the event_enddate tag to print out a hyphen.

    There is no way to not display your text Time(s): using templates. the only way to handle this, is to use some of the provided functions and code it by yourself.

    Thread Starter cruxwireweb

    (@cruxwireweb)

    Thank you, Faebu, this is a great start.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Calendar] Not Showing end date or times -hyphen problem’ is closed to new replies.