NumberFormat in Template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saschavalentin
    Junior Member
    • Jan 2018
    • 14

    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.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #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...