This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #159 Criação de estrutura para correção de bug encontrado no Ze…
…nd Framework.
- Loading branch information
1 parent
c0c941f
commit f56e283
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Balance\I18n\Validator; | ||
|
||
use Zend\I18n\Validator\DateTime as BaseDateTime; | ||
|
||
/** | ||
* Classe para Correção de PR em zendframework/zend-i18n#19 | ||
*/ | ||
class DateTime extends BaseDateTime | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function error($messageKey, $value = null) | ||
{ | ||
$result = parent::error($messageKey, $value); | ||
if (self::INVALID_DATETIME === $messageKey) { | ||
$this->invalidateFormatter = true; | ||
} | ||
return $result; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getIntlDateFormatter() | ||
{ | ||
$formatter = parent::getIntlDateFormatter(); | ||
$this->setTimezone($formatter->getTimezone()); | ||
$this->setCalendar($formatter->getCalendar()); | ||
$this->setPattern($formatter->getPattern()); | ||
return $formatter; | ||
} | ||
} |