Localize date in expense list

This commit is contained in:
Râu Cao
2023-01-13 15:34:43 +08:00
parent a93be41e08
commit 138cec0389
3 changed files with 14 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
import { helper } from '@ember/component/helper';
import getLocale from 'kredits-web/utils/get-locale';
export default helper(function(dateStr) {
const date = new Date(dateStr);
const locale = getLocale();
return new Intl.DateTimeFormat(locale).format(date);
});