Permalink
Browse files

Merge branch 'hotfix/4687'

Close #4687
  • Loading branch information...
2 parents 70ed53e + d088cd3 commit 9ba4202ab7f5626ba0def7cb148a9e4cbfec5ae8 @mwillbanks mwillbanks committed Jun 25, 2013
@@ -92,8 +92,8 @@ protected function getDaysOptions($pattern)
$result = array();
for ($day = 1; $day <= 31; $day++) {
- $key = $keyFormatter->format($date);
- $value = $valueFormatter->format($date);
+ $key = $keyFormatter->format($date->getTimestamp());
+ $value = $valueFormatter->format($date->getTimestamp());
$result[$key] = $value;
$date->modify('+1 day');
@@ -257,8 +257,8 @@ protected function getMonthsOptions($pattern)
$result = array();
for ($month = 1; $month <= 12; $month++) {
- $key = $keyFormatter->format($date);
- $value = $valueFormatter->format($date);
+ $key = $keyFormatter->format($date->getTimestamp());
+ $value = $valueFormatter->format($date->getTimestamp());
$result[$key] = $value;
$date->modify('+1 month');
@@ -89,4 +89,11 @@ public function testInvokeWithNoElementChainsHelper()
{
$this->assertSame($this->helper, $this->helper->__invoke());
}
+
+ public function testDayElementValueOptions()
+ {
+ $element = new DateSelect('foo');
+ $this->helper->render($element);
+ $this->assertEquals(31, count($element->getDayElement()->getValueOptions()));
+ }
}
@@ -89,4 +89,11 @@ public function testInvokeWithNoElementChainsHelper()
{
$this->assertSame($this->helper, $this->helper->__invoke());
}
+
+ public function testMonthElementValueOptions()
+ {
+ $element = new MonthSelect('foo');
+ $this->helper->render($element);
+ $this->assertEquals(12, count($element->getMonthElement()->getValueOptions()));
+ }
}

0 comments on commit 9ba4202

Please sign in to comment.