Announcement

Collapse
No announcement yet.

NumberFormat in Template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NumberFormat in Template

    Is it possible in a template for PDF print to change the format of a date/time field?

    I ask because "createdAt" is a date/time field but for the output I only nee the date part.

  • #2
    Hi,
    it's possible only if you create additional field.

    in custom/Espo/Custom/Resources/metadata/entityDefs/{YourEntity}.php (For example Quote)
    Code:
    {
        "fields":{
            "dateCreated": {
               "type": "date",
               "readOnly": true,
               "notStorable": true,
               "select": "DATE(quote.created_at)"
            }
        }
    }
    instead of quote set the name of your table (EntityName in "lower_case_with_underscores")
    Administration > Rebuild.

    Add this field to the template
    Last edited by yuri; 06-15-2018, 05:16 PM.

    Comment

    Working...
    X