0

When Symfony2 renders a form input of type "timezone", it uses the names from the time zone database (e.g. "America/Los Angeles") for both the option values and the display.

Is there a way to display a more user-friendly name for each zone (for users who don't know which Olson/IANA time zone they're in), e.g. the UTC offset and a list of major cities in that time zone?

Alf Eaton
  • 5,226
  • 4
  • 45
  • 50
  • You could probably define your own input type ("friendlyTimezone"), make it extend timezone, and just change the array used to construct the select. – MrGlass Dec 07 '12 at 14:29
  • 1
    you should be able to just extend it and replace the getTimezones method https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php – MrGlass Dec 07 '12 at 14:42
  • That sounds like the right approach, and http://stackoverflow.com/a/600403/145899 points to a CSV of city/offset/timezone information. – Alf Eaton Dec 07 '12 at 16:04

0 Answers0