jorditost / week-list-view

Customization of the Week view of The Calendar Plugin PRO by Modern Tribe
0 stars 0 forks source link

It appears the get_formatted_date_title() function is not included #1

Open mikeamcbrien opened 10 years ago

mikeamcbrien commented 10 years ago

Hey ran across this repo when I was looking for a list week view. Found this issue, and do you have a more recent commit since it appears to be working on your site?

Thanks

jorditost commented 10 years ago

Hi Mike,

I created this repo to share the structure of my view with the support team of the The Events Calendar plugin for Wordpress.

I use there some functions (like get_formatted_date_title()) that are custom functions of my WP Theme. The function you mention is this one:

function get_formatted_date_title($date_to_format) {

    $date = tribe_event_format_date($date_to_format, false, 'D-j-F-Y');
    $date_array = explode("-", $date);
    $weekday = $date_array[0];
    $day = $date_array[1];
    $month = $date_array[2];
    $year = $date_array[3];

    return $weekday . ' <strong>' . $day . '</strong> ' . $month . ' ' . $year;
}

But you could use directly the tribe_events_week_get_the_day_display() template tag.

There was some bug in this code that I could fix last week. Since at least there is one people using it (you :-)) I've just done a commit with this bug fixes. I spent a lot of time trying to figure it out how the week view works and override it. I hope it can help you.

By the way, to use it you need the PRO version of the plugin, since this overrides the week view provided by it (and uses functions created by their week view class). A better practice would be to create a new view from scratch. You can use the Agenda View by the support team as a reference: https://github.com/moderntribe/tribe-events-agenda-view

It is possible that in my code there are some other custom functions (in the single-event.php file) or that you find some other bugs.

A known issue is, that it only shows hourly events, but not all-day events. This is because in the week view you can only set the loop to show hourly events or day events, but not both types at a time. See the week/loop.php file, line 11, function tribe_events_week_set_loop_type( 'hourly' );. For me it wasn't a problem since I don't need them. If you need both event types, maybe you should write a new view from scratch, based on the plugin's week view and modify the loop behaviour.

Feel free to ask more questions here, notify some other issues and please, share your advances and findings! :-)

mikeamcbrien commented 10 years ago

Fantastic, thank you very much for teh quick update.

Beyond a handful of other custom functions in your single-event.php it appears to be working good. Thanks.

Do you know of a way that i can have this display Sunday Through Saturday, opposed to the next 7 days?

jorditost commented 10 years ago

Hi Mike,

Great, that you can use it! You can configure the week to start on sunday on the Wordpress Settings page (not the plugin's settings page). It should be in Settings > General or Settings > Reading.

Cheers