Added publication date on epub export

This commit is contained in:
Nicolas Lœuillet 2020-04-06 15:34:32 +02:00
parent fbfeb20062
commit 0bddd34847
No known key found for this signature in database
GPG Key ID: 3A8718BE51C3BA8E
17 changed files with 23 additions and 0 deletions

View File

@ -196,10 +196,17 @@ class EntriesExport
$authors = implode(',', $publishedBy); $authors = implode(',', $publishedBy);
} }
$publishedAt = $entry->getPublishedAt();
$publishedDate = $this->translator->trans('export.unknown');
if (!empty($publishedAt)) {
$publishedDate = $entry->getPublishedAt()->format('Y-m-d');
}
$titlepage = $content_start . $titlepage = $content_start .
'<h1>' . $entry->getTitle() . '</h1>' . '<h1>' . $entry->getTitle() . '</h1>' .
'<dl>' . '<dl>' .
'<dt>' . $this->translator->trans('entry.view.published_by') . '</dt><dd>' . $authors . '</dd>' . '<dt>' . $this->translator->trans('entry.view.published_by') . '</dt><dd>' . $authors . '</dd>' .
'<dt>' . $this->translator->trans('entry.metadata.published_on') . '</dt><dd>' . $publishedDate . '</dd>' .
'<dt>' . $this->translator->trans('entry.metadata.reading_time') . '</dt><dd>' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '</dd>' . '<dt>' . $this->translator->trans('entry.metadata.reading_time') . '</dt><dd>' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '</dd>' .
'<dt>' . $this->translator->trans('entry.metadata.added_on') . '</dt><dd>' . $entry->getCreatedAt()->format('Y-m-d') . '</dd>' . '<dt>' . $this->translator->trans('entry.metadata.added_on') . '</dt><dd>' . $entry->getCreatedAt()->format('Y-m-d') . '</dd>' .
'<dt>' . $this->translator->trans('entry.metadata.address') . '</dt><dd><a href="' . $entry->getUrl() . '">' . $entry->getUrl() . '</a></dd>' . '<dt>' . $this->translator->trans('entry.metadata.address') . '</dt><dd><a href="' . $entry->getUrl() . '">' . $entry->getUrl() . '</a></dd>' .

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'Om' page_title: 'Om'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'Über' page_title: 'Über'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% min" reading_time_minutes_short: "%readingTime% min"
address: "Address" address: "Address"
added_on: "Added on" added_on: "Added on"
published_on: "Published on"
about: about:
page_title: 'About' page_title: 'About'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% min" reading_time_minutes_short: "%readingTime% min"
address: "Dirección" address: "Dirección"
added_on: "Añadido el" added_on: "Añadido el"
# published_on: "Published on"
about: about:
page_title: 'Acerca de' page_title: 'Acerca de'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'درباره' page_title: 'درباره'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% min" reading_time_minutes_short: "%readingTime% min"
address: "Adresse" address: "Adresse"
added_on: "Ajouté le" added_on: "Ajouté le"
published_on: "Publié le"
about: about:
page_title: "À propos" page_title: "À propos"

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'A proposito' page_title: 'A proposito'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% 分" reading_time_minutes_short: "%readingTime% 分"
address: "アドレス" address: "アドレス"
added_on: "追加日" added_on: "追加日"
# published_on: "Published on"
about: about:
page_title: 'アプリについて' page_title: 'アプリについて'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% min" reading_time_minutes_short: "%readingTime% min"
address: "Adreça" address: "Adreça"
added_on: "Ajustat a" added_on: "Ajustat a"
# published_on: "Published on"
about: about:
page_title: 'A prepaus' page_title: 'A prepaus'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'O nas' page_title: 'O nas'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% min" reading_time_minutes_short: "%readingTime% min"
address: "Endereço" address: "Endereço"
added_on: "Adicionado o" added_on: "Adicionado o"
# published_on: "Published on"
about: about:
page_title: 'Sobre' page_title: 'Sobre'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'Despre' page_title: 'Despre'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'О' page_title: 'О'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'เกี่ยวกับ' page_title: 'เกี่ยวกับ'

View File

@ -285,6 +285,7 @@ entry:
# reading_time_minutes_short: "%readingTime% min" # reading_time_minutes_short: "%readingTime% min"
# address: "Address" # address: "Address"
# added_on: "Added on" # added_on: "Added on"
# published_on: "Published on"
about: about:
page_title: 'Hakkımızda' page_title: 'Hakkımızda'

View File

@ -285,6 +285,7 @@ entry:
reading_time_minutes_short: "%readingTime% 分钟" reading_time_minutes_short: "%readingTime% 分钟"
address: "地址" address: "地址"
added_on: "添加于" added_on: "添加于"
# published_on: "Published on"
about: about:
page_title: '关于' page_title: '关于'