Back to PhocacartDate class

Method getDateDays

public static
getDateDays
(mixed $fromDate, mixed $toDate)

Method getDateDays - Source code

public static function getDateDays($fromDate, $toDate)
{
    $fromDate = \DateTime::createFromFormat('Y-m-d', $fromDate);
    $toDate = \DateTime::createFromFormat('Y-m-d', $toDate);
    if ($fromDate == false || $toDate == false) {
        return array();
    }
    return new \DatePeriod($fromDate, new \DateInterval('P1D'), $toDate->modify('+1 day'));
}