You are here

function appointment_calendar_daysbetween in Appointment Calendar 8

Same name and namespace in other branches
  1. 7 appointment_calendar.module \appointment_calendar_daysbetween()

Implements function to get days in between from and to dates.

2 calls to appointment_calendar_daysbetween()
AppointmentCalendarForm::submitForm in src/Form/AppointmentCalendarForm.php
Form submission handler.
AppointmentCalendarForm::validateForm in src/Form/AppointmentCalendarForm.php
Form validation handler.

File

./appointment_calendar.module, line 160

Code

function appointment_calendar_daysbetween($start, $end) {

  // Get days in between from and to dates.
  $dates = [];
  while ($start <= $end) {
    array_push($dates, strtotime(date('Y-m-d', $start)));
    $start += 86400;
  }
  return $dates;
}