Jump to content

Change the background color of the rows (records) on a data page based the on date (past or future)

Recommended Posts

I am having an issue with working with the date field.

What I am trying to do is: I want to change the background color of the rows (records) on a data page if a date from that record is older than the current date (Timestamp). Please see my source code from the HTML block below.

It seems working if the date and the current date is from the same year. However, it is not working if the dates (record date and current date) are from two different years.

How can I solve this issue?


[@field:files_File_Number] <a id="visi[@field:actions_Action_ID]"> <script>

var isi = document.getElementById("visi[@field:actions_Action_ID]");
isi.parentNode.parentNode.style.backgroundColor = '#fcd4d4';
isi.parentNode.parentNode.style.backgroundColor = '#NoColor';

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...