Orckestra C1: Can a Date formatter be applied to a Tree Definition DataElement Label attribute?

61 views Asked by At

I know for a Tree Definition of DataElementFolder, there is a DateFormat attribute, but the DataElement node doesn't have such an attribute.

<DataElements Type="MA.PressRelease.Article" Label="${C1:Data:MA.PressRelease.Article:Date}" Display="Auto">

This will show up looking like this.

enter image description here

It would be nice to have something like "Month day, Year" (Ex: May 4, 2017)

3

There are 3 answers

1
Alfred Severo On

https://github.com/Orckestra/C1-CMS-Foundation/issues, open a new issue, starting with the Title "Feature Request:" make a clear explanation about the benefits and anything else that you think that would improve and wait for response.

0
Dmitry Dzygin On
0
mawtex On

Per version 6.2 of C1 CMS you can control the label format for fields of type DateTime, decimal and int - thanks to your feature request.

Usage: Append a colon and then a format string to your label directive, for example:

<DataElements Type="MA.PressRelease.Article" Label="${C1:Data:MA.PressRelease.Article:Date:MMM d, yyyy}" Display="Auto">

The format string is the same you would use with .ToString() for the type of the field, ex "MMM d, yyyy" for dates, "F1" or "C" for decimals and ints.