Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Format Date Field As: Day Name/Month/Date/Year

Avatar

Level 2

Is there a way to validate a 'date' field so it displays a date as: Tuesday, July 5th 2016 instead of 7/5/2016? Even if the 'day name' is abbreviated (Tue instead of Tuesday) is fine. I can't seem to find out how to format this way. Also, most of the date formats also have a time value associated with them. I don't want/need the time in this field.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Just to try to make it crystal clear!

1. Add a Date/Time Field

2. Click on "Patterns..." -> "Display" (in the "Field" tab in the "Object palette")

3. Enter date{EEEE, D MMMM YYYY} in the "pattern" entry box.

I think there is a preset one that is pretty much identical to this one in the predefined display patterns aswell.

View solution in original post

7 Replies

Avatar

Level 10

Hi,

If you are getting formatting options for time then you are using the Date/Time Field, try a Date Field with a display pattern of date{EEEE, D MMMM YYYY}.

This isn't exactly what you are after as it wont give you the ordinal (st, nd, th).  If you want that you have to write you own formatting (or use one of the JavaScript date libraries, like MomentJS)

Regards

Bruce

Avatar

Level 2

Hi Bruce,

i appreciate the response. Perhaps I am missing something, but I don't have a 'date' field option. In my list I only have a 'date/time' field. I assumed there would be one for a date but I haven't found it. I'm using version 9 ES2, maybe my version is too old?

Livecycle.png

Avatar

Level 3

You should be using the Date/Time field.
It contains support for being both a time and a date field, you simply just set what kind you want in its settings.

When chosen as a date field, that is what would be referred to as a date field. I think that might be a "experience" gap, as people who are used to working with these fields, just refer to it as a Date/Time field, and take it as common knowledge that people know what to do with them. And if you are a bit less experienced maybe you don't catch on instantly. It's sort of a language barrier of experience

To switch between time and date in your Date/Time fields you go into the "Binding" palette, and there you have the choice between "Date" , "Time" and "Date and Time". The "Date" is default for the actual field. So for what you want to achieve, simply chuck in a "Date/Time" field, and change it's display pattern in the manner Bruce explained above.

What Bruce meant by you being wrong in having a "Date/Time" field, was simply him implying you had the multifunctional Date/Time field set up as a "Date and Time" field, (as you evidentally had the choice to specify time in your display pattern).

Hope this cleared things up a little even though it got a bit ranty

regards, Mattias.

Avatar

Correct answer by
Level 3

Just to try to make it crystal clear!

1. Add a Date/Time Field

2. Click on "Patterns..." -> "Display" (in the "Field" tab in the "Object palette")

3. Enter date{EEEE, D MMMM YYYY} in the "pattern" entry box.

I think there is a preset one that is pretty much identical to this one in the predefined display patterns aswell.

Avatar

Level 2

Awesome guys, thank you so much! I was definitely missing the change in the 'bindings' to be date only. I assumed that there had to be something allowing me to drop the time requirement but was unable to locate it previously. I really appreciate it!

PS: Completely off topic, but do either of you know of a way to force the field values to be uppercase?

Avatar

Level 3

I am afraid I do not, am personally quite a beginner in LiveCycle, a quick google gave me this thread though.

How to force ALLCAPS in Date/Time Field

Am quite certain the two first answers in that topic will help you out. Niall is a real veteran so I would be certain his solutions will work fine without having tried it myself.

I would mark Bruce's answer as correct in this thread aswell btw, then the thread will be labeled "answered". And if you found my posts helpful feel free to tag them that way aswell.

Regards, Mattias