Exemplo n.º 1
0
 public function getIgDateMasked()
 {
     $dateTime = new FuzzyDateTime($this->_get('ig_date'), $this->_get('ig_date_mask'));
     return $dateTime->getDateMasked();
 }
Exemplo n.º 2
0
$testArray['year'] = '';
$t->is(FuzzyDateTime::checkDateTimeStructure($testArray), 'year_missing', 'Date structure test ok');
$testArray['year'] = '1975';
$testArray['month'] = '02';
$testArray['day'] = '';
$testArray['hour'] = '02';
$t->is(FuzzyDateTime::checkDateTimeStructure($testArray), 'day_missing', 'Date structure test ok');
$testArray['year'] = '0001';
$testArray['month'] = '01';
$testArray['day'] = '01';
$fdt = new FuzzyDateTime($testArray);
$t->is($fdt->format('d/m/Y'), '01/01/0001', 'Date lower bound format ok');
$testArray = array('year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => '', 'second' => '');
$fdt = new FuzzyDateTime('2009/12/05');
$t->is_deeply($fdt->getDateTimeMaskedAsArray(), $testArray, 'array is the same');
$testArray = array('year' => 2009, 'month' => 12, 'day' => '', 'hour' => '', 'minute' => '', 'second' => '');
$fdt->setMask(48);
$t->is_deeply($fdt->getDateTimeMaskedAsArray(), $testArray, 'array is the same');
$testArray = array('year' => 2009, 'month' => 12, 'day' => 05, 'hour' => '', 'minute' => '', 'second' => '');
$fdt->setMask(56);
$t->is_deeply($fdt->getDateTimeMaskedAsArray(), $testArray, 'array is the same');
$testArray = array('year' => 2009, 'month' => 2);
$t->is('2009/02/28', FuzzyDateTime::getDateTimeStringFromArray($testArray, false), 'Date are nicelly completed with missing day in fev');
$testArray = array('year' => 2009, 'month' => 12);
$t->is('2009/12/31', FuzzyDateTime::getDateTimeStringFromArray($testArray, false), 'Date are nicelly completed  with missing day in decembre');
$testArray = array('year' => 2009, 'month' => 100);
$t->is('2038/12/31', FuzzyDateTime::getDateTimeStringFromArray($testArray, false), 'Default date is set from wrong dates');
$fdt = new FuzzyDateTime(array('year' => '2005', 'month' => '02', 'day' => '02', 'hour' => '01', 'minute' => 0, 'second' => 0), 63, false, true);
$fdt->setDateFormat('Y/m/d');
$t->is($fdt->getDateMasked(), '2005/02/02 01:00:00', 'Default date is set from wrong dates');
 /**
  * Get the Modification Date masked with tag $tag depending on the mask value
  * @param string $tag Tag wich will be arround fuzzy values (default < em >)
  * @return string the Date masked
  */
 public function getModificationDateTimeMasked($tag = 'em')
 {
     $dateTime = new FuzzyDateTime($this->_get('modification_date_time'), $this->_get('modification_date_mask'), true, true);
     return $dateTime->getDateMasked($tag);
 }
Exemplo n.º 4
0
 /**
  * Get the From date masked with tag $tag depending on the mask value
  * @param string $tag Tag wich will be arround fuzzy values (default < em >)
  * @return string the Date masked
  */
 public function getToDateMasked($tag = 'em')
 {
     $dateTime = new FuzzyDateTime($this->_get('date_to'), $this->_get('date_to_mask'), false, true);
     return $dateTime->getDateMasked($tag);
 }
Exemplo n.º 5
0
 public function getLastModifiedDate()
 {
     $dateTime = new FuzzyDateTime($this->_get('updated_at') != '' ? $this->_get('updated_at') : $this->_get('created_at'));
     return $dateTime->getDateMasked('em', 'd/m/Y H:i');
 }
Exemplo n.º 6
0
 public function getGtuToDateMasked()
 {
     $dateTime = new FuzzyDateTime($this->_get('gtu_to_date'), $this->_get('gtu_to_date_mask'), false, true);
     return $dateTime->getDateMasked();
 }
Exemplo n.º 7
0
 public function getAcquisitionDateMasked()
 {
     $dateTime = new FuzzyDateTime($this->_get('acquisition_date'), $this->_get('acquisition_date_mask'));
     return $dateTime->getDateMasked();
 }
Exemplo n.º 8
0
 public function getCreationDateMasked()
 {
     $dateTime = new FuzzyDateTime($this->_get('creation_date'), $this->_get('creation_date_mask'), false, false);
     return $dateTime->getDateMasked();
 }
Exemplo n.º 9
0
 public function getExpeditionToDateMasked()
 {
     $dateTime = new FuzzyDateTime($this->_get('expedition_to_date'), $this->_get('expedition_to_date_mask'));
     return $dateTime->getDateMasked();
 }