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.

Time Field Input

Avatar

Former Community Member

Hello,

Apparently with all the valid edit patterns for a time field, if I want to enter 6 AM quickly, the least I have to put in is "06" (without quotes, of course).  But if I put in "6" without the leading zero, the field does not get formatted as a time.  Is there any way to force this without writing custom code?  I am trying to cover the various input methods.  I have tried all the available Select Types and also modified a couple to examples such as:

time{h:MM}

time{h}

These result in an error stating the pattern is not valid.  Is there something I can do to allow more freedom for entry, and still format the data so I can later calcualte another field based on the data.?  I just want to put in a single digit number to get a value before 10 AM.  Ideally putting "3p" in the field would give me 3:00 PM as well, but this may be too much to ask for.

1 Reply

Avatar

Level 10

Hi,

If you set the Display Pattern to time{h:MM A}, then entering 15 will give you 3:00 PM.

I don't think you will be able to get a single digit (eg 9) to be recognised as a valid time.

Niall