$t->is(FuzzyDateTime::checkDateTimeStructure($testArray), 'month_missing', 'Date structure test ok'); $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');
<?php } ?> </td> </tr> <tr> <th><?php echo __('Activity date to'); ?> </th> <td> <?php if (FuzzyDateTime::getDateTimeStringFromArray($people->getActivityDateTo()->getRawValue()) != '0001/01/01') { ?> <?php echo FuzzyDateTime::getDateTimeStringFromArray($people->getActivityDateTo()->getRawValue()); ?> <?php } else { ?> - <?php } ?> </td> </tr> </table>
?> </th> <td> <?php echo FuzzyDateTime::getDateTimeStringFromArray($expedition->getExpeditionFromDate()->getRawValue()); ?> </td> </tr> <tr> <th><?php echo $form['expedition_to_date']->renderLabel(); ?> </th> <td> <?php echo FuzzyDateTime::getDateTimeStringFromArray($expedition->getExpeditionToDate()->getRawValue()); ?> </td> </tr> <tr> <td colspan="2" class="search_form"> <fieldset> <legend><?php echo __('Members'); ?> </legend> <ul> <?php foreach ($form['Members'] as $form_value) { ?>
<tbody> <tr> <th><?php echo __('I.G. number:'); ?> </th> <td> <?php echo $igs->getIgNum(); ?> </td> </tr> <tr> <th><?php echo __('I.G. creation date:'); ?> </th> <td> <?php echo FuzzyDateTime::getDateTimeStringFromArray($igs->getIgDate()->getRawValue()); ?> </td> </tr> </tbody> </table> </div> <?php include_partial('widgets/screen', array('widgets' => $widgets, 'category' => 'cataloguewidgetview', 'columns' => 1, 'options' => array('eid' => $igs->getId(), 'table' => 'igs', 'view' => true))); ?> </div>