feat(i18n): enhanced i18n support (#3761)
This commit is contained in:
1 parent
5a5c4f58af
commit
d14a8f0199
55 files changed
+319
-114
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import moment from 'moment';
|
||||
import i18n from 'i18next';
|
||||
|
||||
/**
|
||||
* Format date
|
||||
@@ -7,7 +8,7 @@ import moment from 'moment';
|
||||
* @param {string} format Desired date format
|
||||
* @returns {string} Formatted date
|
||||
*/
|
||||
export default (date, format = 'DD-MMM-YYYY') => {
|
||||
export default (date, format = i18n.t('Common:localDateFormat','DD-MMM-YYYY')) => {
|
||||
// moment(undefined) returns the current date, so return the empty string instead
|
||||
return date ? moment(date).format(format) : '';
|
||||
};
|
||||
Reference in new issue
Block a user