Asking for help - FC 7.4.x - Formatted dates in the webtop event list

Hi,

I need some help please.

I use an event list for concerts on a website and it works very well. But in the FarCry webtop I need formatted dates in the event list display. At the moment the dates are displayed in a shortened form and that is really not very practical for me. Where (and how) can I change the date format in the webtop event list without changing core files? I would be grateful for any help.

Try adding ftDisplayPrettyDate="false" to your date properties, I think
that should do the trick. If you need a specific date format you can also
use ftDateFormatMask.

cheers,
Justin

Thanks for your reply, but using ftDisplayPrettyDate="false" in my /projects/packages/types/dmEventListing.cfc does not have any impact, when I use:

...
<cfproperty name="startDate" type="date" required="no" default="" 
    ftSeq="20" ftFieldset="Termin - Details" ftLabel="Datum / Zeit" 
    ftType="datetime" ftDefaultType="Evaluate" ftDefault="now()" 
    ftDateFormatMask="dd. mmm. yyyy" ftTimeFormatMask="hh:mm tt" 
    ftToggleOffDateTime="false" ftDisplayPrettyDate="false" />
...

I think, what I do need was described by Andrew Mercer under: https://farcry.jira.com/browse/FC-2381. Probably I have to do something like that in /projects/webskin/dmEvent/webtopBody.cfm, because I want to change the display in the webtop - right ?

<!— @@displayname: Event Webtop Body —>

<cfimport taglib="/farcry/core/tags/formtools" prefix="ft" />

<!--- Override the client side validation for the filter fields. --->
<cfset stFilterMetaData = structNew() />
<cfset stFilterMetaData.title.ftValidation = "" />

<!--- Does NOT work, because the attribute "stPropMetaData" does not exist in "ft:objectadmin" ! --->
<cfset stPropMetaData = structNew() />
<cfset stPropMetaData.startdate.ftDisplayPrettyDate  = "FALSE" />
<cfset stPropMetaData.startDate.ftDateMask = "dd.mm.yyyy" />
<cfset stPropMetaData.publishDate.ftDateMask = "dd.mm.yyyy" />
<cfset stPropMetaData.datetimecreated.ftDateMask = "dd.mm.yyyy" />

<ft:objectadmin 
    typename="dmEvent"
    permissionset="event"
    title="#application.rb.getResource('eventsAdministration', 'Event Administration')#"
    columnList="title,startDate,catevent,publishdate,datetimelastUpdated"
    sortableColumns="title,startDate,publishdate,datetimelastUpdated"
    lFilterFields="title"
    stProMetaData="#stPropMetaData#"
    stFilterMetaData="#stFilterMetaData#" 
    sqlorderby="startDate asc" />

<cfsetting enablecfoutputonly="false">

Hmmm, ftDisplayPrettyDate="false" works for me…

I took an existing custom content type, copied the datetimecreated property from types.cfc into it:

<cfproperty name="datetimecreated" displayname="Datetime created" type="date" hint="Timestamp for record creation." required="yes" default="" ftType="datetime" ftLabel="Created"> 

And then I added these 3 attributes to the property:

ftDisplayPrettyDate="false" ftDateMask="dd/mm/yy" ftShowTime="false" 

Note that it is ftDateMask which is used for displaying a date as output, whereas ftDateFormatMask is used only for date/input fields.

1 Like

Is startDate a property of dmEventListing.cfc or dmEvent.cfc? Looks like dmEvent.cfc for me.

ftDisplayPrettyDate works here, and should work in all version back to at least 7.0 maybe earlier too.

ftDisplayPrettyDate="false" ftDateMask="dd.mm.yyyy" ftTimeMask="HH:MM"

1 Like