X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdatetime.php;h=0faea8c90e5fd9e4b8caa31242021f5fb88e584e;hb=b4d14164bb47a76e62977447816fae5b65ea4da7;hp=a17c405dc365ea391d3ada2fd0c3f16d82f3e855;hpb=b067a1114679ebc3dc6132759c511c3ac8b73e49;p=friendica.git
diff --git a/include/datetime.php b/include/datetime.php
index a17c405dc3..0faea8c90e 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -4,6 +4,9 @@
* @brief Some functions for date and time related tasks.
*/
+use Friendica\Core\Config;
+use Friendica\Core\PConfig;
+use Friendica\Database\DBM;
/**
* @brief Two-level sort for timezones.
@@ -13,20 +16,27 @@
* @return int
*/
function timezone_cmp($a, $b) {
- if(strstr($a,'/') && strstr($b,'/')) {
- if ( t($a) == t($b)) return 0;
+ if (strstr($a, '/') && strstr($b, '/')) {
+ if ( t($a) == t($b)) {
+ return 0;
+ }
return ( t($a) < t($b)) ? -1 : 1;
}
- if(strstr($a,'/')) return -1;
- if(strstr($b,'/')) return 1;
- if ( t($a) == t($b)) return 0;
+
+ if (strstr($a, '/')) {
+ return -1;
+ } elseif (strstr($b, '/')) {
+ return 1;
+ } elseif ( t($a) == t($b)) {
+ return 0;
+ }
return ( t($a) < t($b)) ? -1 : 1;
}
/**
* @brief Emit a timezone selector grouped (primarily) by continent
- *
+ *
* @param string $current Timezone
* @return string Parsed HTML output
*/
@@ -38,23 +48,24 @@ function select_timezone($current = 'America/Los_Angeles') {
usort($timezone_identifiers, 'timezone_cmp');
$continent = '';
- foreach($timezone_identifiers as $value) {
+ foreach ($timezone_identifiers as $value) {
$ex = explode("/", $value);
- if(count($ex) > 1) {
- if($ex[0] != $continent) {
- if($continent != '')
+ if (count($ex) > 1) {
+ if ($ex[0] != $continent) {
+ if ($continent != '') {
$o .= '';
+ }
$continent = $ex[0];
$o .= '';
$continent = t('Miscellaneous');
$o .= '