public function ageDataProvider() { $oneYearAgo = new \DateTime('-1 year'); $oneMonthAgo = new \DateTime('-1 month'); $oneYearTwoMonthAgo = new \DateTime('-1 year -2 months'); $tenYearsAgo = new \DateTime('-10 years'); $inFuture = new \DateTime('+1 year'); return [[$oneYearAgo->format('Y-m-d'), [], 1], [$oneYearAgo->format('m/d/Y'), ['format' => 'm/d/Y'], 1], [$tenYearsAgo->format('m/d/Y'), ['format' => 'm/d/Y', 'timezone' => 'UTC'], 10], [$oneMonthAgo, [], 0], [$oneYearAgo, [], 1], [$oneMonthAgo, [], 0], [$oneYearTwoMonthAgo, [], 1], [$tenYearsAgo, [], 10], [$inFuture, [], null], [$inFuture, ['default' => 'N/A'], null]]; }
public function ageDataProvider() { $oneYearAgo = new \DateTime('-1 year'); $oneMonthAgo = new \DateTime('-1 month'); $oneYearTwoMonthAgo = new \DateTime('-1 year -2 months'); $tenYearsAgo = new \DateTime('-10 years'); $inFuture = new \DateTime('+1 year'); return array(array($oneYearAgo->format('Y-m-d'), array(), 1), array($oneYearAgo->format('m/d/Y'), array('format' => 'm/d/Y'), 1), array($tenYearsAgo->format('m/d/Y'), array('format' => 'm/d/Y', 'timezone' => 'UTC'), 10), array($oneMonthAgo, array(), 0), array($oneYearAgo, array(), 1), array($oneMonthAgo, array(), 0), array($oneYearTwoMonthAgo, array(), 1), array($tenYearsAgo, array(), 10), array($inFuture, array(), null), array($inFuture, array('default' => 'N/A'), null)); }