better date formatting
This commit is contained in:
parent
6f35ab6261
commit
5c75379bb1
1 changed files with 6 additions and 1 deletions
|
@ -447,7 +447,12 @@
|
||||||
let formatted = ''
|
let formatted = ''
|
||||||
try {formatted = new Intl.DateTimeFormat(this.app.cfg.general.language?.replace('_','-') ?? 'en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);}
|
try {formatted = new Intl.DateTimeFormat(this.app.cfg.general.language?.replace('_','-') ?? 'en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);}
|
||||||
catch(e){
|
catch(e){
|
||||||
formatted = new Intl.DateTimeFormat('en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);
|
// use the format in json instead
|
||||||
|
if (this.app.getLz('date.format') != null){
|
||||||
|
formatted = new this.app.getLz('date.format').replace("${d}", releaseDate.getDate()).replace("${m}", releaseDate.getMonth()).replace("${y}", releaseDate.getFullYear());
|
||||||
|
} else {
|
||||||
|
formatted = new Intl.DateTimeFormat('en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return prefix + formatted
|
return prefix + formatted
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue