function end_date_load in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Loads a DateTime object from a string.
Parameters
string $end_date: Expects to see a date in the form Y-m-d
Return value
DateTime Object or null if invalid
2 calls to end_date_load()
- book_unit_form_submit in modules/
rooms_booking_manager/ rooms_booking_manager.module - Submit callback for book_unit_form form.
- rooms_booking_manager_override_confirmation_form_submit in modules/
rooms_booking_manager/ rooms_booking_manager.confirmation_override.inc - Submit hanlder for the confirmation form.
File
- modules/
rooms_booking_manager/ rooms_booking_manager.module, line 2184 - Rooms Booking Manager brings together all the pieces required to find a room and book it - including the DrupalCommerce integration
Code
function end_date_load($end_date) {
$end_date = check_plain($end_date);
// Try to create a date time object.
try {
$ed = new DateTime($end_date);
} catch (Exception $e) {
$ed = 0;
}
return $ed;
}