format-date parameters

74
2
Jump to solution
05-17-2018 10:08 AM
MikeOnzay
Regular Contributor

Are there other parameters available that are not listed in the help guide under formulas? I would like to have a full name text day rather than a three letter day. I want it to match what is in Due Date.

three letter day

Is there a parameter for hour that is based on 12 hour time?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Mike,

The documented list provides all the options for format-date; a full day name is not supported.  The options are limited by the XLSForm and XForm specification, which don't have an option for a full day.  It would be possible to reconstruct the full day based on the short day:

if(${short_day} = 'Sun' or ${short_day} = 'Mon' or ${short_day} = 'Fri', concat(${short_day}, 'day'), if(${short_day} = 'Tue', 'Tuesday', if(${short_day} = 'Wed', 'Wednesday', if(${short_day} = 'Thu', 'Thursday', 'Saturday'))))

View solution in original post

2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Mike,

The documented list provides all the options for format-date; a full day name is not supported.  The options are limited by the XLSForm and XForm specification, which don't have an option for a full day.  It would be possible to reconstruct the full day based on the short day:

if(${short_day} = 'Sun' or ${short_day} = 'Mon' or ${short_day} = 'Fri', concat(${short_day}, 'day'), if(${short_day} = 'Tue', 'Tuesday', if(${short_day} = 'Wed', 'Wednesday', if(${short_day} = 'Thu', 'Thursday', 'Saturday'))))

View solution in original post

MikeOnzay
Regular Contributor

Thanks for the clarification and suggestion. Here was my final calculation

if(format-date(${intake_date},'%a') = 'Sun' or format-date(${intake_date},'%a') = 'Mon' or format-date(${intake_date},'%a') = 'Fri', concat(concat(format-date(${intake_date},'%a'), 'day'),format-date(${intake_date},', %b %e, %Y')),if(format-date(${intake_date},'%a') = 'Tue', concat('Tuesday',format-date(${intake_date},', %b %e, %Y')),if(format-date(${intake_date},'%a') = 'Wed', concat('Wednesday',format-date(${intake_date},', %b %e, %Y')),if(format-date(${intake_date},'%a') = 'Thu', concat('Thursday',format-date(${intake_date},', %b %e, %Y')),concat('Saturday',format-date(${intake_date},', %b %e, %Y'))))))

0 Kudos