With all do respect to the Joomla community and developers, I find the time zone implementation absurd. While it may make sense on the server / admin side, it makes no sense for end users who use the apps that are developed to ride over the top of the convoluted implementation.
That rant complete, I operate a site that has users in 4 time zones (but lets go with all 6):
HST Hawaii Standard Time
AKDT Alaska Daylight Time
PDT Pacific Daylight Time
MST Mountain Standard Time
UMDT Mountain Daylight Time
CDT Central Daylight Time
EDT Eastern Daylight Time
My intention is to strip all others from the Joomla core file that contains the full list.
Problem is, it has been years since I have seen the offending file.
Anybody know where it hides?
Time Zones
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Guru
- Posts: 565
- Joined: Thu Jan 12, 2017 10:13 am
Re: Time Zones
Better not to change joomla core files, you would like each user from a different country view only its own time zone?
Kian William
Kian William
- effrit
- Joomla! Guru
- Posts: 846
- Joined: Sun Nov 12, 2017 2:21 pm
- Location: middle of Russia
- Contact:
Re: Time Zones
u can add jqury script to page and filter zones u need.
Code: Select all
var arr=["Africa/Abidjan", "Pacific/Fiji", "Atlantic/Canary"]; // here zones we need to show
$('#jform_params_timezone optgroup option').prop('disabled', true).css('display', 'none'); // first, hide all zones
arr.forEach(function(item, i, arr) {
$("#jform_params_timezone optgroup option[value='"+item+"']").prop('disabled', false).css('display', 'block'); // show custom zones
});
http://effrit.com/joomla | clean Word/Excel tables: http://r91228pz.bget.ru
- Per Yngve Berg
- Joomla! Master
- Posts: 30930
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Time Zones
I believe the Time Zones resides in the php library, not in Joomla.
Where do you see Tine Zones in the Front-end?
Time Zone is set in the client OS.
Where do you see Tine Zones in the Front-end?
Time Zone is set in the client OS.
-
- Joomla! Apprentice
- Posts: 11
- Joined: Tue Jun 19, 2018 9:53 pm
Re: Time Zones
Thanks all.
We are all familiar with setting the Joomla time zone via the admin console, and likewise, the user timezone.
In my front end application the same options we admins have are presented to the end users.
We have employees in 3 timezones, and customers in 4. That will never change unless we add employees from a 4th timezone.
It is my intention to remove all other zones from the front end and label those remaining 4 in a more user friendly manner. (PDT Pacific Daylight Time, MST Mountain Standard Time, CDT Central Daylight Time, and EDT Eastern Daylight Time)
I have identified what I might be tempted to call the offending code and short another solution may give effrit's suggestion a shot.
We are all familiar with setting the Joomla time zone via the admin console, and likewise, the user timezone.
In my front end application the same options we admins have are presented to the end users.
We have employees in 3 timezones, and customers in 4. That will never change unless we add employees from a 4th timezone.
It is my intention to remove all other zones from the front end and label those remaining 4 in a more user friendly manner. (PDT Pacific Daylight Time, MST Mountain Standard Time, CDT Central Daylight Time, and EDT Eastern Daylight Time)
I have identified what I might be tempted to call the offending code and short another solution may give effrit's suggestion a shot.
Code: Select all
$regions = [
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Aisa' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC
];
$timezones = [];
foreach ($regions as $name => $mask) {
$zones = DateTimeZone::listIdentifiers($mask);
foreach ($zones as $timezone) {
$timezones[$name][$timezone] = $timezone;
}
}
$actualTimezone = JFactory::getSession()->get('user-timezone', $displayData['dateHelper']->getDate()->getTimezone()->getName(), 'DPCalendar');
?>
<form action="<?php echo JUri::base(); ?>" method="get" class="dp-timezone dp-form">
<span class="dp-timezone__label">
<?php echo $displayData['translator']->translate('COM_DPCALENDAR_CHOOSE_TIMEZONE'); ?>:
</span>
<select name="tz" class="dp-select dp-timezone__select">
<option value="UTC"<?php $actualTimezone == 'UTC' ? ' selected' : ''; ?>>
<?php echo $displayData['translator']->translate('JLIB_FORM_VALUE_TIMEZONE_UTC'); ?>
</option>
<?php foreach ($timezones as $region => $list) { ?>
<?php foreach ($list as $timezone => $name) { ?>
<option value="<?php echo $timezone; ?>"<?php echo $actualTimezone == $timezone ? ' selected' : ''; ?>>
<?php echo $displayData['translator']->translate($name); ?>
</option>
<?php } ?>
<?php } ?>
</select>
<input type="hidden" name="task" value="profile.tz" class="dp-input dp-input-hidden">
<input type="hidden" name="option" value="com_dpcalendar" class="dp-input dp-input-hidden">
<input type="hidden" name="view" value="profile" class="dp-input dp-input-hidden">
<input type="hidden" name="return" value="<?php echo base64_encode(JUri::getInstance()->toString()); ?>" class="dp-input dp-input-hidden">
</form>