change format of datetime in espocrm
Collapse
X
-
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.Leave a comment:
-
I modified client/src/views/fields/data.js based on an old guide, but it seems it no longer has any effect.
Before
AfterCode:// 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'); }
Leave a comment:
-
It can be done only in code. client/src/views/fields/data.js # getValueForDisplayLeave a comment:
-
change format of datetime in espocrm
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/19901 PhotoTags: None

Leave a comment: