diff --git a/src/addon/badges/pages/user-badges/user-badges.html b/src/addon/badges/pages/user-badges/user-badges.html
index 5bcdc3e32..6a2a33a24 100644
--- a/src/addon/badges/pages/user-badges/user-badges.html
+++ b/src/addon/badges/pages/user-badges/user-badges.html
@@ -18,7 +18,7 @@
- {{ badge.dateissued | coreToLocaleString }}
+ {{ badge.dateissued * 1000 | coreFormatDate :'strftimedatetimeshort' }}
= badge.dateexpire">
{{ 'addon.badges.expired' | translate }}
diff --git a/src/addon/calendar/providers/calendar.ts b/src/addon/calendar/providers/calendar.ts
index 3aadd52e0..b02765ed0 100644
--- a/src/addon/calendar/providers/calendar.ts
+++ b/src/addon/calendar/providers/calendar.ts
@@ -527,11 +527,10 @@ export class AddonCalendarProvider {
}
const dateTriggered = new Date((event.timestart - (time * 60)) * 1000),
- startDate = new Date(event.timestart * 1000),
notification = {
id: event.id,
title: event.name,
- text: startDate.toLocaleString(),
+ text: this.timeUtils.userDate(event.timestart * 1000, 'core.strftimedaydatetime', true),
at: dateTriggered,
channelParams: {
channelID: 'notifications',
diff --git a/src/addon/competency/pages/competency/competency.html b/src/addon/competency/pages/competency/competency.html
index 0df736063..34bf134cc 100644
--- a/src/addon/competency/pages/competency/competency.html
+++ b/src/addon/competency/pages/competency/competency.html
@@ -75,7 +75,7 @@
{{ evidence.actionuser.fullname }}
- {{ evidence.timemodified | coreToLocaleString }}
+ {{ evidence.timemodified * 1000 | coreFormatDate }}
{{ evidence.gradename }}
diff --git a/src/addon/competency/pages/plan/plan.html b/src/addon/competency/pages/plan/plan.html
index f434688db..f84bc276e 100644
--- a/src/addon/competency/pages/plan/plan.html
+++ b/src/addon/competency/pages/plan/plan.html
@@ -22,7 +22,7 @@
0">
{{ 'addon.competency.duedate' | translate }}:
- {{ plan.plan.duedate | coreToLocaleString }}
+ {{ plan.plan.duedate * 1000 | coreFormatDate }}
{{ 'addon.competency.template' | translate }}:
diff --git a/src/addon/competency/pages/planlist/planlist.html b/src/addon/competency/pages/planlist/planlist.html
index e89eb51c4..9088d2cf6 100644
--- a/src/addon/competency/pages/planlist/planlist.html
+++ b/src/addon/competency/pages/planlist/planlist.html
@@ -14,7 +14,7 @@
0" no-margin>
{{ plan.name }}
- 0">{{ 'addon.competency.duedate' | translate }}: {{ plan.duedate | coreToLocaleString }}
+ 0">{{ 'addon.competency.duedate' | translate }}: {{ plan.duedate * 1000 | coreFormatDate :'strftimedatetimeshort' }}
{{ plan.statusname }}
diff --git a/src/addon/coursecompletion/components/report/addon-course-completion-report.html b/src/addon/coursecompletion/components/report/addon-course-completion-report.html
index af292dc8e..b4a6a25eb 100644
--- a/src/addon/coursecompletion/components/report/addon-course-completion-report.html
+++ b/src/addon/coursecompletion/components/report/addon-course-completion-report.html
@@ -36,7 +36,7 @@
{{ criteria.status }}
- {{ criteria.timecompleted | coreToLocaleString }}
+ {{ criteria.timecompleted * 1000 | coreFormatDate :'strftimedatetimeshort' }}
diff --git a/src/pipes/to-locale-string.ts b/src/pipes/to-locale-string.ts
index 6a881c468..2bc2bae49 100644
--- a/src/pipes/to-locale-string.ts
+++ b/src/pipes/to-locale-string.ts
@@ -14,6 +14,7 @@
import { Pipe, PipeTransform } from '@angular/core';
import { CoreLoggerProvider } from '@providers/logger';
+import { CoreTimeUtilsProvider } from '@providers/utils/time';
/**
* Filter to format a timestamp to a locale string. Timestamp can be in seconds or milliseconds.
@@ -25,7 +26,7 @@ import { CoreLoggerProvider } from '@providers/logger';
export class CoreToLocaleStringPipe implements PipeTransform {
protected logger;
- constructor(logger: CoreLoggerProvider) {
+ constructor(logger: CoreLoggerProvider, private timeUtils: CoreTimeUtilsProvider) {
this.logger = logger.getInstance('CoreToLocaleStringPipe');
}
@@ -56,6 +57,6 @@ export class CoreToLocaleStringPipe implements PipeTransform {
timestamp = timestamp * 1000;
}
- return new Date(timestamp).toLocaleString();
+ return this.timeUtils.userDate(timestamp, 'core.strftimedatetimeshort');
}
}