Skip to content

Instantly share code, notes, and snippets.

@woogists
Created March 9, 2018 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogists/488bcc6c0e7611bad12a37b36452e04b to your computer and use it in GitHub Desktop.
Save woogists/488bcc6c0e7611bad12a37b36452e04b to your computer and use it in GitHub Desktop.
[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
Copy link

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