- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 08:22 AM
I'm trying to change the font color of the due dates in the list view of PTASKS if the due date is past, but no matter what I try it doesn't seem to work.
Here's what I have now:
Table: Problem Task [problem_task]
Field Name: Due date
Value: javascript:gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) < 0 ;
Style: color:red;
What am I doing wrong?
Also, where can if find a comprehensive list of styles (colors, background, font sizes, etc.) ?
Solved! Go to Solution.
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 12:43 PM
If its exceeding the field limits then you can put the code in script include and from there return true/false.
Like for yellow you could do this.
1) Create a script include (I named mine as TestDate)
2) Then call the script include (and function - which I named isYellow) from Styles
Could you please mark my answer as correct? It gives me few points on community.
Thank you!
-Tanaji
Please mark reply correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 08:15 AM
Hi MB. Any guidance for my last question?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 09:14 AM
Open the same style sheet which you created for problem_task table >> change the table to Task [task] >> insert and stay. With this you will have a copy of this style for task table.
-Tanaji
Please mark response correct/helpful if applicable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 09:23 AM
In case you only want it to be only for problem_task record (but visible on task and problem_task) then ignore my previous comment and update the existing style which you have on problem_task table to look like this-
Table: Task [task]
Field name: Due date
Value:
javascript: var answer = (current.due_date.getDisplayValue() <= (new GlideDateTime().getDisplayValueInternal())) && current.sys_class_name == 'problem_task'; answer;
Style: background-color: red
-Tanaji
Please mark response correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 11:41 AM
Sorry about that. Don't know how I missed that update. Tanaji's answer below should do the trick for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2020 12:22 PM
Sweet! That last value script seems to do the trick. I'm seeing the red dot on all due dates in the past.
Hate to press my luck, but what if I don't want this style for tasks that are "Closed Complete"?