From ef6bd0daf6e8050d2f5d76770a3094cc40aa356c Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 10 Sep 2025 23:47:15 +0200 Subject: [PATCH] Revert "Quick test for production I'll revert" This reverts commit f05320287db6f8a41d8bdfcd4a20a9669178a041. --- .../controllers/local_time_controller.js | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/app/javascript/controllers/local_time_controller.js b/app/javascript/controllers/local_time_controller.js index e3a5d1b38..69693a107 100644 --- a/app/javascript/controllers/local_time_controller.js +++ b/app/javascript/controllers/local_time_controller.js @@ -26,7 +26,6 @@ export default class extends Controller { connect() { this.#timer = setInterval(() => this.#refreshRelativeTimes(), 30_000) - this.refreshAll() } disconnect() { @@ -47,6 +46,42 @@ export default class extends Controller { this.#formatTime(this[`${targetName}Formatter`], target) } + timeTargetConnected(target) { + this.#formatTime(this.timeFormatter, target) + } + + dateTargetConnected(target) { + this.#formatTime(this.dateFormatter, target) + } + + datetimeTargetConnected(target) { + this.#formatTime(this.datetimeFormatter, target) + } + + shortdateTargetConnected(target) { + this.#formatTime(this.shortdateFormatter, target) + } + + agoTargetConnected(target) { + this.#formatTime(this.agoFormatter, target) + } + + indaysTargetConnected(target) { + this.#formatTime(this.indaysFormatter, target) + } + + daysagoTargetConnected(target) { + this.#formatTime(this.daysagoFormatter, target) + } + + agoorweekdayTargetConnected(target) { + this.#formatTime(this.agoorweekdayFormatter, target) + } + + timeordateTargetConnected(target) { + this.#formatTime(this.timeordateFormatter, target) + } + #refreshRelativeTimes() { this.agoTargets.forEach(target => { this.#formatTime(this.agoFormatter, target)