I want to change the format display of datetime in espocrm. Default format is very difficult. I want to change to dd/mm/yyyy. Ex: Jan 23, 1990 -> 23/01/1990
Announcement
Collapse
No announcement yet.
change format of datetime in espocrm
Collapse
X
-
I modified client/src/views/fields/data.js based on an old guide, but it seems it no longer has any effect.
Before
Code:// Need to use UTC, otherwise there's a DST issue with old dates. dateTime = moment.utc(valueWithTime, internalDateTimeFormat); if (dateTime.format('YYYY') === today.format('YYYY')) { return dateTime.format(readableFormat); } return dateTime.format(readableFormat + ', YYYY'); }
Code:// Need to use UTC, otherwise there's a DST issue with old dates. dateTime = moment.utc(valueWithTime, internalDateTimeFormat); if (dateTime.format('YYYY') === today.format('YYYY')) { return dateTime.format('DD/MM/YYYY'); } return dateTime.format('DD/MM/YYYY'); }
Comment
-
Hello,
to avoid display as "yesterday" or alike, check the checkbox in your datefield to "numeric value". For single date fields you could use the formula datetime/format -> https://docs.espocrm.com/administrat...datetimeformat
With this approach you won`t have to code anything.
- Likes 1
Comment
-
Originally posted by shalmaxb View PostHello,
to avoid display as "yesterday" or alike, check the checkbox in your datefield to "numeric value". For single date fields you could use the formula datetime/format -> https://docs.espocrm.com/administrat...datetimeformat
With this approach you won`t have to code anything.
Comment
Comment