Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Issue #159 Criação de estrutura para correção de bug encontrado no Ze…
Browse files Browse the repository at this point in the history
…nd Framework.
  • Loading branch information
wandersonwhcr committed Dec 15, 2015
1 parent c0c941f commit f56e283
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions module/Balance/src/Balance/I18n/Validator/DateTime.php
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;
}
}

0 comments on commit f56e283

Please sign in to comment.