How to set Date field Value in specific format?

Nawal Kishor S2
Tera Guru

Hi Experts,

 

I want to show two date field value in DD-MM-YYYY format , for that i have created client script to change the format, it's working fine , but when i'm setting the value into the fields it showing me "Invalide Format". I know it is happen from system properties( Date format) field . currently its showing in yyyy-mm-dd format.

 

so how can i set for those two fields ,please brief me on this and let me know if there is any OOB dependencies?

 

Thank you

5 REPLIES 5

OlaN
Giga Sage
Giga Sage

Hi,

The system property you point to sets the display format for all the date fields everywhere, so changing that will affect all date fields.

This system property can be overridden by a personal setting by a specific user, but again, this will affect all date fields, not a subset of them.

 

There is (to my knowledge) no way of changing the date format on just a single or a few date fields.
What did you do in your client script that changes the format?

Nawal Kishor S2
Tera Guru

I don't want to touch other fields, I want to change the two fields only

 

Sorry, not doable as far as I know.

What's the use case for having a different format just on some date fields?

From a user perspective, I think it would be quite confusing if some date fields expect input as YYYY-MM-DD, and some other fields expect input as DD-MM-YYYY

Satishkumar B
Giga Sage
Giga Sage

@Nawal Kishor S2 The system's default date format is controlled by the glide.sys.date_format property. By default, it's set to YYYY-MM-DD. Changing this globally might affect other areas. though client script would not be able to set the value as per you expected format as it won't accept the format. I suggest you creating a custom string field and copy you converted format value in that field.

…………………………………………........................................................................................
Mark it helpful 👍and Accept Solution !! If this helps you to understand.

…………………………………………........................................................................................