Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WooCommerce Bookings] Modify the date in a booking’s summary
/**
* wc_bookings_summary_list_date is used to filter a booking's summary date.
* This example removes the end date for a multi-day booking.
*
* @param string $booking_date The formatted date that is displayed by default.
* @param int $booking_start Timestamp for the booking start time/date.
* @param int $booking_end Timestamp for the booking end time/date.
* @return string The modified date string.
*/
function modify_summary_date_20170821( $booking_date, $booking_start, $booking_end ) {
return date( 'F j, Y', $booking_start );
}
add_filter( 'wc_bookings_summary_list_date', 'modify_summary_date_20170821', 10, 3 );
@gfaulk09

This comment has been minimized.

Copy link

@gfaulk09 gfaulk09 commented May 14, 2018

how can I use this to force it to show booking start time and end time.. currently it only shows end time/date if the end date is on a different day than start date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment