in table view
I have a field date (d-m-Y format) but (Y-m-d in db format)
how can I do for
have date-field colored red
if date-field previous to today
thanks
colored fonts date-field if previus today
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: colored fonts date-field if previus today
Hi,
you can use the hooks/TABLENAME.php file and within the header function you can add the following (assuming you use tableview only):
you can use the hooks/TABLENAME.php file and within the header function you can add the following (assuming you use tableview only):
Code: Select all
case 'tableview':
$header="<%%HEADER%%><script type=\"text/javascript\">
\$j(function(){
\$j('td.parent-when_provided a').each(function() {
// ADD YOUR CODE TO COMPARE THAT DATE AGAINST TODAY DATE
if ( CHECK IS POSITIV) {
\$j(this).css('color', 'red');
}
});
});
</script>";
break;
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.