Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIM-1763] Change date format for modified date for article and statistics #2793

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/resources/lib/ssb/utils/dateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function formatDate(date: string | undefined, formatType: string, languag
let libTimePattern = formatType
// https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/format/DateTimeFormatter.html#patterns
if (formatType === 'PPP') libTimePattern = language === 'en' ? 'd MMMM u' : 'd. MMMM u'
if (formatType === 'PPpp') libTimePattern = language === 'en' ? 'd MMM u, HH:mm:ss' : 'd. MMM u HH:mm:ss'
if (formatType === 'PPp') libTimePattern = language === 'en' ? 'd MMM u, HH:mm' : 'd. MMM u HH:mm'

let libTimeResult
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/site/parts/article/article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function renderPart(req: XP.Request) {
if (showModifiedDate) {
modifiedDate = formatDate(showModifiedDate.dateOption?.modifiedDate, 'PPP', language)
if (showModifiedDate.dateOption?.showModifiedTime) {
modifiedDate = formatDate(page.data.showModifiedDate?.dateOption?.modifiedDate, 'PPpp', language)
modifiedDate = formatDate(page.data.showModifiedDate?.dateOption?.modifiedDate, 'PPp', language)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/site/parts/statistics/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function renderPart(req: XP.Request): XP.Response {

if (page.data.showModifiedDate && previousReleaseDate && modifiedDate) {
if (isAfter(new Date(modifiedDate), new Date(previousReleaseDate))) {
changeDate = formatDate(modifiedDate, 'PPpp', language)
changeDate = formatDate(modifiedDate, 'PPp', language)
}
}

Expand Down
Loading