We would like to highlight the due date in red once the date has passed.
Via Velocity processed Message Custom Field (for view),
customfield_10000-val - to hide the name of your field:
<script type="text/javascript"> jQuery(document).ready(function () { jQuery('#customfield_10000-val').parent().hide(); var content = jQuery("#due-date").html(); var fullDate = new Date(); var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) : '0' + (fullDate.getMonth()+1); var currentDate = fullDate.getFullYear() + "-" + twoDigitMonth + "-" + fullDate.getDate(); if (new Date(content) <= new Date(currentDate)) { jQuery("#due-date").css('background-color', 'red'); } }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.