Merged in [19716] from jennifer@painless-security.com:

Update CSS selectors to update times/timezones for any elements with .time/.current-tz classes, not just span. Fixes #3485.
 - Legacy-Id: 19733
Note: SVN reference [19716] has been migrated to Git commit 50bdddb624
This commit is contained in:
Robert Sparks 2021-12-01 22:52:43 +00:00
commit a87c7b6235

View file

@ -19,7 +19,7 @@ var get_current_tz_cb = function () {
// Initialize moments // Initialize moments
function initialize_moments() { function initialize_moments() {
var times=$('span.time') var times=$('.time')
$.each(times, function(i, item) { $.each(times, function(i, item) {
item.start_ts = moment.unix(this.getAttribute("data-start-time")).utc(); item.start_ts = moment.unix(this.getAttribute("data-start-time")).utc();
item.end_ts = moment.unix(this.getAttribute("data-end-time")).utc(); item.end_ts = moment.unix(this.getAttribute("data-end-time")).utc();
@ -134,7 +134,7 @@ function format_tooltip(start, end) {
// Add tooltips // Add tooltips
function add_tooltips() { function add_tooltips() {
$('span.time').each(function () { $('.time').each(function () {
var tooltip = $(format_tooltip(this.start_ts, this.end_ts)); var tooltip = $(format_tooltip(this.start_ts, this.end_ts));
tooltip[0].start_ts = this.start_ts; tooltip[0].start_ts = this.start_ts;
tooltip[0].end_ts = this.end_ts; tooltip[0].end_ts = this.end_ts;
@ -146,8 +146,8 @@ function add_tooltips() {
// Update times on the agenda based on the selected timezone // Update times on the agenda based on the selected timezone
function update_times(newtz) { function update_times(newtz) {
$('span.current-tz').html(newtz); $('.current-tz').html(newtz);
$('span.time').each(function () { $('.time').each(function () {
if (this.format == 4) { if (this.format == 4) {
var tz = this.start_ts.tz(newtz).format(" z"); var tz = this.start_ts.tz(newtz).format(" z");
if (this.start_ts.tz(newtz).dayOfYear() == if (this.start_ts.tz(newtz).dayOfYear() ==