Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Date formats and rawValue

Avatar

Level 2

Hi,

Is there a way to change the default rawValue of a date field. It seems to be my locale (Australia) default of D/MM/YY. I would like to make it appear as DD-MMM-YYYY.

I am also trying to add it to a Text Field, with a view to inserting into the middle of a sentence once a date has been chosen, using the datefield.rawValue. The Text Field seems to want to only display it as YYYY-MM-DD.

Thanks in advance for any help with or consideration of this problem.

Cheers,

Greig

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

you can use a display pattern format the date in the way you want it.

date{DD-MMMM-YYYY}

To use the formatted date in another field refer to the formattedValue instead of the rawValue.

var d = datefield.formattedValue;

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

you can use a display pattern format the date in the way you want it.

date{DD-MMMM-YYYY}

To use the formatted date in another field refer to the formattedValue instead of the rawValue.

var d = datefield.formattedValue;

Avatar

Level 2

Thanks again radzmar for your help. Exactly what I was looking for but failing to find in the manuals.