- 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-12-2020 08:44 AM
Hi Joe
Can you try changing value to this format. Please ignore if you already tried it
javascript: var answer = gs.dateDiff(current.due_date.getDisplayValue(),gs.nowDateTime(),true) < 0; answer;
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 09:45 AM
Thanks for the suggestion. This didn't work either. I think my issue is more fundamental. I tried just changing the value to just "true" to see if my style rule was even getting applied. This didn't work either. So I must be missing something basic to make the style rules active or something.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 10:40 AM
Use this Value-
javascript: var answer = (current.due_date.getDisplayValue() <= (new GlideDateTime().getDisplayValueInternal())); answer;
I tested it works.
I usually check all exisiting style shees for reference and some you need to try if not already used in system.
-Tanaji
Please mark response correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 12:45 PM
I have stopped trying to figure out the Jave script logic, because I can't even get ANY new style definition to work.
As an experiment, I tried the simplest one I could think of.
This should just turn the font for the State column red on every Problem ticket if it's "Open".
Table: Problem
Field Name: State
Value: Open
color:red;
This doesn't work! What am I missing?