Datetime field display

  • 1
  • Question
  • Updated 3 years ago

I have two datetime fields pulled into a tab set of two tabs. One datetime field is from the model which shows the date as: 7/03/2014 4:38 pm; The other field is a template from different model which show date as : 2014-10-14T05:12:42.000+0000

Is there any way the second date format can be aligned to first one?

Cheers

Photo of zoe

zoe

  • 306 Points 250 badge 2x thumb
  • confused

Posted 3 years ago

  • 1
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Review your template and check if you are using double or triple braces.  I believe that you should use double braces to achieve the desired formatting.

{{CreatedDate}} vs. {{{CreatedDate}}}
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Irvin is correct. 
Photo of zoe

zoe

  • 306 Points 250 badge 2x thumb
Thanks, Irvin and Rob. We ended up changing model to the conjunction object to fetch the format properly. :)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
So you were using a child relationshiop field.  

There is a known bug where child relationship fields are not formatted correctly when you follow the canonical process for including child relationship fields in a table or field editor: 1. Select child object to include in model. (Object now appears in left hand panel field list) 
2. Click on object in field list to define fields and filters. 
3. Drag object from field list into the component. It appears as a template where fields selected can be defined using merge syntax.

When this mechanism is used - field renderers are not run and raw data is included in the page. Rather than 7/03/2014 4:38 pm we get 2014-10-14T05:12:42.000+0000

There is however a workaround:  Drag a template component from the component list into the table or field editor and use the following syntax: 

{{#ChildObjectName.records}}{{FieldName}}{{/ChildObjectName.records}} 


This will show the field with correct formatting.