Single day view grabs wrong date from multi-day event

Home Forums Calendar Products Events Calendar PRO Single day view grabs wrong date from multi-day event

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #21718
    baynature
    Participant

    We’re using ECP Pro 2.0.7 plus Community Events 1.0.1 on a soon-to-launch site at staging.baynature.org, running WordPress 3.4.1.

    Here’s a page from our implementation: http://staging.baynature.org/events/2012-07-26/
    We modified the calendar widget to allow users to click on a day and go to that day (the Ajax popups were nice but not manageable when we will have 10-20 events/day).

    As you can see on the above link, the single-day view is pulling the H4 date and the Window Title from the first event in the list, which happens to be a long-running training. So the URL date is 2012-07-26, so we’d expect to see an H4 of July 26, 2012, and a Window Title like “Events, July 26, 2012”.

    Is there a way to edit list.php to make this happen?

    Thanks and great plugin!

    #21748
    Jonah
    Participant

    Hi Dan,

    What you’ll need to do is override the titles being spit out in the page template and in the header in your theme. Then, conditionally set the titles with something like this: https://gist.github.com/aad337b8f0662d4df1b6 – you’ll of course need to modify this to use markup specific to your theme but that’s basically what you’ll need to do.

    I hope that helps!

    – Jonah

    #21796
    baynature
    Participant

    Hi Jonah,

    Thanks. We’re still having trouble with this. The only date var I see referenced in the code snippet you sent is “eventDate”. Isn’t that going to feed from the start date of the first event on the page (which is a multi-day event starting in the past)? So won’t that duplicate the problem we’re already having?

    We tried this:
    query_vars[‘eventDate’])); ?>
    but that displays Jan 1, 1970 (as shown here: http://staging.baynature.org/events/2012-07-31/).
    In any case, what we’re trying to do is display the selected day as shown in the URL but the page title and WP date stamp are different. Then the only function that I see with the calendar is the start date. So if it’s a multi-day event then you view Saturday’s page but it displays Friday’s date because that’s when the event started.

    Maybe the solution is to grab the last element of the URL and pull that date in and format it in the page title and HTML?

    #21842
    baynature
    Participant

    FYI,I came up with a hack that works for the title on the page for now anyway. Not too pretty, but the best I can do while my real coders work on bigger issues. Looks like this (note sure how to show code snippets here):

    =2) ) {
    echo date(‘F j, Y’, strtotime($maybeDate));
    }
    ?>

    #21843
    baynature
    Participant

    Oops, code snippet got chopped. Oh well. Suffice it to say we have it mostly working for now.

    #21885
    Jonah
    Participant

    Hi Dan,

    Glad to hear you’ve got this working. So are you all set here?

    – Jonah

    #977301
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Single day view grabs wrong date from multi-day event’ is closed to new replies.