From cd99d2a07d93ffe90c23d6a8dbcc89052abbf929 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Wed, 1 Jun 2011 12:09:28 -0500 Subject: [PATCH 1/2] Use mktime instead of gmmaketime. On the 1st of every month the following options are generated: I do not totally understand the problem but using mktime instead of gmmktime fixes the issue. --- .../Form/Extension/Core/ChoiceList/MonthChoiceList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php index 58e54be70d..dc14f900db 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php @@ -46,7 +46,7 @@ class MonthChoiceList extends PaddedChoiceList foreach ($this->choices as $choice => $value) { // It's important to specify the first day of the month here! - $this->choices[$choice] = $this->formatter->format(gmmktime(0, 0, 0, $value, 1)); + $this->choices[$choice] = $this->formatter->format(mktime(0, 0, 0, $value, 1)); } // I'd like to clone the formatter above, but then we get a From 611dbf1bfe1561f1e19a9eead49dcaf7ea35a2f9 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Thu, 2 Jun 2011 13:47:58 -0700 Subject: [PATCH 2/2] Revert back to using gmmktime and use day 15 instead of 1 to avoid edge case --- .../Form/Extension/Core/ChoiceList/MonthChoiceList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php index dc14f900db..40df32e533 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/MonthChoiceList.php @@ -46,7 +46,7 @@ class MonthChoiceList extends PaddedChoiceList foreach ($this->choices as $choice => $value) { // It's important to specify the first day of the month here! - $this->choices[$choice] = $this->formatter->format(mktime(0, 0, 0, $value, 1)); + $this->choices[$choice] = $this->formatter->format(gmmktime(0, 0, 0, $value, 15)); } // I'd like to clone the formatter above, but then we get a