How to highlight the custom start date field with red color on form view and list view of table if the start date is in past?

Community Alums
Not applicable

Hi Experts,

I have one requirement to highlight the start date field with red color if the date is in past if we compare with the current date when we are filling the form. Please give your inputs on this.

Best Regards,

Prachi

1 ACCEPTED SOLUTION

Hi Prachi,

Use the code - 

javascript: GlideDateTime.subtract(new GlideDateTime(current.avventer_svar_innen),  new GlideDateTime()).getDayPart() > 0;

Refer the community article - https://community.servicenow.com/community?id=community_question&sys_id=4e8a6f36db81041023f4a345ca961997

Regards,

Deepankar Mathur

View solution in original post

6 REPLIES 6

Hi Prachi,

Use the code - 

javascript: GlideDateTime.subtract(new GlideDateTime(current.avventer_svar_innen),  new GlideDateTime()).getDayPart() > 0;

Refer the community article - https://community.servicenow.com/community?id=community_question&sys_id=4e8a6f36db81041023f4a345ca961997

Regards,

Deepankar Mathur

Community Alums
Not applicable

It's working now. Thank you