Skip to content

Commit

Permalink
dont implicitly set the timezone in the datetime validator
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kühne <[email protected]>
  • Loading branch information
MatthiasKuehneEllerhold committed Dec 8, 2023
1 parent 9938d6e commit b168eb2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Validator/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public function __construct($options = [])
$this->calendar = IntlDateFormatter::GREGORIAN;

parent::__construct($options);

if (null === $this->timezone) {
$this->timezone = date_default_timezone_get();
}
}

/**
Expand Down Expand Up @@ -209,6 +205,10 @@ public function getTimezone()
return $this->getIntlDateFormatter()->getTimeZoneId();
}

if (null === $this->timezone) {
return date_default_timezone_get();
}

return $this->timezone;
}

Expand All @@ -233,7 +233,7 @@ public function setLocale($locale)
*/
public function getLocale()
{
if (nulll === $this->locale) {
if (null === $this->locale) {
return Locale::getDefault();
}
return $this->locale;
Expand Down

0 comments on commit b168eb2

Please sign in to comment.