using javascript:condition in the "Value field" of "Field Styles : what syntax can i use to compare two date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 06:50 AM
Hi All,
I want to defined a style by using javascript:condition in the "Value field" of "Field Styles" to set the background color. i don't what is the right syntax to compare two .
Exemple :
In a task i want a red color in a list if closed>due-date and a green color if closed<=due-date
Thanks & Regards,
Isabelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 07:08 AM
Hello,
Can you try this out and see if it works
javascript:gs.dateDiff(current.closed_at.getDisplayValue(), current.due_date.getDisplayValue(), true) > 0
Please change your column names as it exist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 07:12 AM
I have tested and it was working, please set this as your Value. Create 2 different styles
One with value as
javascript:gs.dateDiff(current.closed_at.getDisplayValue(), current.due_date.getDisplayValue(), true) > 0
and other with value as
javascript:gs.dateDiff(current.closed_at.getDisplayValue(), current.due_date.getDisplayValue(), true) < 0
And set up your color styling accordingly.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2018 10:52 PM
Have you tried this out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2018 06:46 AM