private function getDatesToInvalidateFromString($dates)
    {
        $toInvalidate = array();
        $invalidDates = array();

        $dates = explode(',', trim($dates));
        $dates = array_unique($dates);

        foreach ($dates as $theDate) {
            $theDate = trim($theDate);
            try {
                $date = Date::factory($theDate);
            } catch (\Exception $e) {
                $invalidDates[] = $theDate;
                continue;
            }

            if ($date->toString() == $theDate) {
                $toInvalidate[] = $date;
            } else {
                $invalidDates[] = $theDate;
            }
        }

        return array($toInvalidate, $invalidDates);
    }
private function getDatesToInvalidateFromString($dates)
    {
        $toInvalidate = array();
        $invalidDates = array();

        $dates = explode(',', trim($dates));
        $dates = array_unique($dates);

        foreach ($dates as $theDate) {
            $theDate = trim($theDate);
            try {
                $date = Date::factory($theDate);
            } catch (\Exception $e) {
                $invalidDates[] = $theDate;
                continue;
            }

            if ($date->toString() == $theDate) {
                $toInvalidate[] = $date;
            } else {
                $invalidDates[] = $theDate;
            }
        }

        return array($toInvalidate, $invalidDates);
    }
private function getDatesToInvalidateFromString ( $ dates ) { $ toInvalidate = array ( ) ; $ invalidDates = array ( ) ; $ dates = explode ( ',' , trim ( $ dates ) ) ; $ dates = array_unique ( $ dates ) ; foreach ( $ dates as $ theDate ) { $ theDate = trim ( $ theDate ) ; try { $ date = Date :: factory ( $ theDate ) ; } catch ( \ Exception $ e ) { $ invalidDates [ ] = $ theDate ; continue ; } if ( $ date -> toString ( ) == $ theDate ) { $ toInvalidate [ ] = $ date ; } else { $ invalidDates [ ] = $ theDate ; } } return array ( $ toInvalidate , $ invalidDates ) ; }
Ensure the specified dates are valid.
Store invalid date so we can log them
@param array $dates
@return Date[]
Ensure the specified dates are valid . Store invalid date so we can log them