fix(ui): use timezone-aware formatting for Last Read timestamps in book detail and progress sync modal
Replace hardcoded 12-hour Format() calls with FormatTimestamptzInTimezone() so that the Last Read time respects the user's selected timezone preference. Both book_detail.templ and book_detail_modals.templ now use the same timezone-aware helper that was introduced in the timezone support feature.
This commit is contained in:
@@ -250,7 +250,7 @@ templ BookDetail(user User, book handlers.MediaDetail, errorMessage string) {
|
||||
if book.ReadingProgress.LastReadAt.Valid {
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Last Read</p>
|
||||
<p>{ book.ReadingProgress.LastReadAt.Time.Format("01-02-2006 03:04 PM") }</p>
|
||||
<p>{ templates.FormatTimestamptzInTimezone(book.ReadingProgress.LastReadAt, user.Timezone) }</p>
|
||||
</div>
|
||||
}
|
||||
if book.ReadingProgress.LastSyncSource.Valid {
|
||||
|
||||
@@ -110,7 +110,7 @@ templ ProgressSyncModal(book handlers.MediaDetail) {
|
||||
}
|
||||
if book.ReadingProgress.LastReadAt.Valid {
|
||||
<p class="text-sm mt-2" style="color: var(--text-secondary);">
|
||||
Last read: { book.ReadingProgress.LastReadAt.Time.Format("01-02-2006 03:04 PM") }
|
||||
Last read: { FormatTimestamptzInTimezone(book.ReadingProgress.LastReadAt, user.Timezone) }
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user