summaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Collection.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Model/Collection.php b/src/Model/Collection.php
index 803e777..62bbf98 100644
--- a/src/Model/Collection.php
+++ b/src/Model/Collection.php
@@ -8,7 +8,6 @@ use Exception;
use Iterator;
use App\Script\Input;
use DateTime;
-use DateTimeZone;
use Countable;
/**
@@ -192,19 +191,18 @@ class Collection implements ArrayAccess, Iterator, Countable
if ($covers = (int) $input->getOption('c')) {
$this->filterByCovers($covers);
}
-
-
- // day - delivery day (dd/mm/yy)
- // time - delivery time in 24h format (hh:mm)
- // location - delivery location (postcode without spaces, e.g. NW43QB)
- // covers - number of people to feed
}
public function filterByDateTime(string $date, string $time)
{
$dateTime = DateTime::createFromFormat('d/m/y G:i', $date . ' ' . $time);
- $dateTime->setTImezone(new DateTImeZone('Europe/London'));
+ if (!$dateTime) {
+ throw new Exception(
+ 'Unable to parse datetime. Required time format: `G:i` (e.g. 05:30). '
+ . 'Required date format: `d/m/y` (e.g. 22/06/18)'
+ );
+ }
$out = [];
foreach ($this->models as $model) {
if ($model->checkDate($dateTime)) {