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

Commit

Permalink
Issue #159 Remoção de formatação estática de datas.
Browse files Browse the repository at this point in the history
  • Loading branch information
wandersonwhcr committed Dec 15, 2015
1 parent f56e283 commit ed48cdd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
7 changes: 6 additions & 1 deletion module/Balance/src/Balance/InputFilter/Postings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Balance\InputFilter;

use Balance\I18n;
use Balance\Model\EntryType;
use Balance\Model\Persistence\ValueOptionsInterface;
use Balance\Posting\Checker;
use IntlDateFormatter;
use NumberFormatter;
use Zend\Filter;
use Zend\InputFilter\CollectionInputFilter;
Expand Down Expand Up @@ -43,7 +45,10 @@ public function init()
// Data e Hora
$input = new Input();
$input->getValidatorChain()
->attach(new Validator\Date(array('format' => 'd/m/Y H:i:s')));
->attach(new I18n\Validator\DateTime(array(
'dateType' => IntlDateFormatter::MEDIUM,
'timeType' => IntlDateFormatter::MEDIUM,
)));
$this->add($input, 'datetime');

// Descrição
Expand Down
7 changes: 6 additions & 1 deletion module/Balance/src/Balance/InputFilter/Search/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Balance\InputFilter\Search;

use Balance\I18n;
use IntlDateFormatter;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
use Zend\Validator;
Expand All @@ -17,7 +19,10 @@ public function init()
$input = (new Input('datetime'))
->setRequired(false);
$input->getValidatorChain()
->attach(new Validator\Date(array('format' => 'd/m/Y H:i:s')));
->attach(new I18n\Validator\DateTime(array(
'dateType' => IntlDateFormatter::MEDIUM,
'timeType' => IntlDateFormatter::MEDIUM,
)));
$this->add($input);
}
}
12 changes: 10 additions & 2 deletions module/Balance/src/Balance/InputFilter/Search/Postings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Balance\InputFilter\Search;

use Balance\I18n;
use IntlDateFormatter;
use Zend\Filter;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
Expand Down Expand Up @@ -31,14 +33,20 @@ public function init()
$input = (new Input('datetime_begin'))
->setRequired(false);
$input->getValidatorChain()
->attach(new Validator\Date(array('format' => 'd/m/Y H:i:s')));
->attach(new I18n\Validator\DateTime(array(
'dateType' => IntlDateFormatter::MEDIUM,
'timeType' => IntlDateFormatter::MEDIUM,
)));
$this->add($input);

// Data e Hora Final
$input = (new Input('datetime_end'))
->setRequired(false);
$input->getValidatorChain()
->attach(new Validator\Date(array('format' => 'd/m/Y H:i:s')));
->attach(new I18n\Validator\DateTime(array(
'dateType' => IntlDateFormatter::MEDIUM,
'timeType' => IntlDateFormatter::MEDIUM,
)));
$this->add($input);
}
}

0 comments on commit ed48cdd

Please sign in to comment.