colored fonts date-field if previus today

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
G Belgrado
Veteran Member
Posts: 61
Joined: 2017-03-12 09:24

colored fonts date-field if previus today

Post by G Belgrado » 2019-09-17 10:26

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

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: colored fonts date-field if previus today

Post by pbottcher » 2019-09-18 19:46

Hi,

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.

Post Reply