You are here

function start_date_load in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Loads a DateTime object from a string.

Parameters

string $start_date: Expects to see a date in the form Y-m-d

Return value

DateTime Object or null if invalid

2 calls to start_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 2160
Rooms Booking Manager brings together all the pieces required to find a room and book it - including the DrupalCommerce integration

Code

function start_date_load($start_date) {
  $start_date = check_plain($start_date);

  // Try to create a date time object.
  try {
    $sd = new DateTime($start_date);
  } catch (Exception $e) {
    $sd = 0;
  }
  return $sd;
}