diff --git a/app/components/app-chrome.hbs b/app/components/app-chrome.hbs
index fccca668..5bb9ce0d 100644
--- a/app/components/app-chrome.hbs
+++ b/app/components/app-chrome.hbs
@@ -15,7 +15,7 @@
{{#if @editorDocument.updatedOn}}
- {{t "utility.savedOn"}} {{human-friendly-date @editorDocument.updatedOn}}
+ {{t "utility.savedOn"}} {{human-friendly-date @editorDocument.updatedOn locale=this.intl.primaryLocale}}
{{else}}
diff --git a/app/components/app-chrome.js b/app/components/app-chrome.js
index 569d2193..c4348d86 100644
--- a/app/components/app-chrome.js
+++ b/app/components/app-chrome.js
@@ -5,6 +5,7 @@ import { action } from '@ember/object';
export default class AppChromeComponent extends Component {
@service currentSession;
@service features;
+ @service intl;
get documentStatus() {
const status = this.args.documentContainer?.get('status');
diff --git a/app/helpers/human-friendly-date.js b/app/helpers/human-friendly-date.js
index 73ff9219..8de64558 100644
--- a/app/helpers/human-friendly-date.js
+++ b/app/helpers/human-friendly-date.js
@@ -1,18 +1,18 @@
-import { helper } from '@ember/component/helper';
import formatRelative from 'date-fns/formatRelative';
-import { nl } from 'date-fns/locale';
+import locales from 'date-fns/locale';
-// this is a helper to mimic the moment-calendar behaviour
-export default helper(function humanFriendlyDate(
- [referenceDatetime] /*, hash*/
-) {
- //If not a date (e.g. date is undefined) return "" for printing on screen.
- if (!(referenceDatetime instanceof Date)) return '';
+function getDateFnsLocale(locale) {
+ return locales[locale] ?? locales[locale.substring(0, 2)];
+}
+export default function humanFriendlyDate(date, { locale = 'nl-BE' } = {}) {
+ if (!(date instanceof Date)) return '';
try {
- return formatRelative(referenceDatetime, new Date(), { locale: nl });
+ return formatRelative(date, new Date(), {
+ locale: getDateFnsLocale(locale),
+ });
} catch (e) {
console.error(e);
return '';
}
-});
+}