mirror of
https://github.com/gotson/komga.git
synced 2025-12-16 13:33:49 +01:00
fix(webui): display release date without timezone adjustment
closes #818
This commit is contained in:
parent
8272cbe52a
commit
d343740f30
2 changed files with 7 additions and 4 deletions
|
|
@ -104,7 +104,7 @@ export class BookItem extends Item<BookDto> {
|
|||
default:
|
||||
let text
|
||||
if (context.includes(ItemContext.RELEASE_DATE))
|
||||
text = this.item.metadata.releaseDate ? new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium'} as Intl.DateTimeFormatOptions).format(new Date(this.item.metadata.releaseDate)) : i18n.t('book_card.no_release_date')
|
||||
text = this.item.metadata.releaseDate ? new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium', timeZone: 'UTC'} as Intl.DateTimeFormatOptions).format(new Date(this.item.metadata.releaseDate)) : i18n.t('book_card.no_release_date')
|
||||
else if (context.includes(ItemContext.DATE_ADDED))
|
||||
text = new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium'} as Intl.DateTimeFormatOptions).format(new Date(this.item.created))
|
||||
else if (context.includes(ItemContext.READ_DATE))
|
||||
|
|
@ -162,7 +162,7 @@ export class SeriesItem extends Item<SeriesDto> {
|
|||
|
||||
let text
|
||||
if (context.includes(ItemContext.RELEASE_DATE))
|
||||
text = this.item.booksMetadata.releaseDate ? new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium'} as Intl.DateTimeFormatOptions).format(new Date(this.item.booksMetadata.releaseDate)) : i18n.t('book_card.no_release_date')
|
||||
text = this.item.booksMetadata.releaseDate ? new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium', timeZone: 'UTC'} as Intl.DateTimeFormatOptions).format(new Date(this.item.booksMetadata.releaseDate)) : i18n.t('book_card.no_release_date')
|
||||
else if (context.includes(ItemContext.DATE_ADDED))
|
||||
text = new Intl.DateTimeFormat(i18n.locale, {dateStyle: 'medium'} as Intl.DateTimeFormatOptions).format(new Date(this.item.created))
|
||||
else if (context.includes(ItemContext.DATE_UPDATED))
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@
|
|||
:to="{ name: 'browse-book', params: { bookId: book.id }, query: { context: context.origin, contextId: context.id} }"
|
||||
>
|
||||
<v-list-item-title class="text-wrap text-body-2">
|
||||
<template v-if="contextReadList">{{ book.seriesTitle }} {{ book.metadata.number }}: {{ book.metadata.title }}</template>
|
||||
<template v-if="contextReadList">{{ book.seriesTitle }} {{ book.metadata.number }}:
|
||||
{{ book.metadata.title }}
|
||||
</template>
|
||||
<template v-else>{{ book.metadata.number }} - {{ book.metadata.title }}</template>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
|
@ -146,7 +148,7 @@
|
|||
|
||||
<v-col cols="auto" v-if="book.metadata.releaseDate">
|
||||
{{
|
||||
new Intl.DateTimeFormat($i18n.locale, {dateStyle: 'long'}).format(new Date(book.metadata.releaseDate))
|
||||
new Intl.DateTimeFormat($i18n.locale, {dateStyle: 'long', timeZone: 'UTC'}).format(new Date(book.metadata.releaseDate))
|
||||
}}
|
||||
</v-col>
|
||||
|
||||
|
|
@ -418,6 +420,7 @@ import {convertErrorCodes} from '@/functions/error-codes'
|
|||
import RtlIcon from '@/components/RtlIcon.vue'
|
||||
import {BookSseDto, LibrarySseDto, ReadListSseDto, ReadProgressSseDto} from '@/types/komga-sse'
|
||||
import {RawLocation} from 'vue-router/types/router'
|
||||
import {zonedTimeToUtc} from 'date-fns-tz'
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'BrowseBook',
|
||||
|
|
|
|||
Loading…
Reference in a new issue