feat(galerie): heure d'envoi en légende quand l'invité n'a laissé ni prénom ni mot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,7 +129,18 @@ function renderPolaroid(photo, { animate = false } = {}) {
|
||||
const caption = document.createElement("p");
|
||||
caption.className = "polaroid__caption";
|
||||
if (captionParts.length === 0) {
|
||||
// Sans prénom ni mot : l'heure d'envoi (« 22 h 14 »), en heure de Paris.
|
||||
caption.classList.add("polaroid__caption--empty");
|
||||
const sentAt = new Date(photo.uploaded_at);
|
||||
if (!Number.isNaN(sentAt.getTime())) {
|
||||
caption.textContent = new Intl.DateTimeFormat("fr-FR", {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
timeZone: "Europe/Paris",
|
||||
})
|
||||
.format(sentAt)
|
||||
.replace(":", " h ");
|
||||
}
|
||||
} else {
|
||||
caption.textContent = captionParts.join(" — ");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user