Refresh local time target when morphed

Alternative to https://github.com/basecamp/fizzy/pull/486
This commit is contained in:
Jorge Manrubia
2025-05-13 05:44:19 +02:00
parent cb6a001ba2
commit 515396263e
3 changed files with 8 additions and 2 deletions
@@ -37,6 +37,12 @@ export default class extends Controller {
})
}
refreshTarget(event) {
const target = event.target;
const targetName = target.dataset.localTimeTarget
this.#formatTime(this[`${targetName}Formatter`], target)
}
timeTargetConnected(target) {
this.#formatTime(this.timeFormatter, target)
}