* Example: preselect Europe/Paris
* list($htmlform, $js) = generateTimeZoneForm('Europe/Paris');
*
- * @param string $preselected_timezone preselected timezone (optional)
+ * @param string $preselectedTimezone preselected timezone (optional)
*
- * @return an array containing the generated HTML form and Javascript code
+ * @return array containing the generated HTML form and Javascript code
**/
function generateTimeZoneForm($preselectedTimezone='')
{
$pcity = substr($preselectedTimezone, $spos+1);
}
- // Display config form:
- $timezoneForm = '';
- $timezoneJs = '';
-
// The list is in the form 'Europe/Paris', 'America/Argentina/Buenos_Aires'
// We split the list in continents/cities.
$continents = array();
* @param string $continent the timezone continent
* @param string $city the timezone city
*
- * @return whether continent/city is a valid timezone
+ * @return bool whether continent/city is a valid timezone
*/
function isTimeZoneValid($continent, $city)
{
- if ($continent == 'UTC' && $city == 'UTC') {
- return true;
- }
-
return in_array(
$continent.'/'.$city,
timezone_identifiers_list()