change format of datetime in espocrm

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Decepticon
    replied
    Originally posted by shalmaxb
    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.
    That's great! It's working perfectly. Thank you for sharing this

    Leave a comment:


  • shalmaxb
    replied
    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:


  • Decepticon
    replied
    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');
    }
    After
    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:


  • yuri
    replied
    It can be done only in code. client/src/views/fields/data.js # getValueForDisplay

    Leave a comment:


  • hoangphuc091
    started a topic change format of datetime in espocrm

    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/1990
Working...