Macro to highlight dates on a schedule that are prior to a specified date

New Here ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

I have a large construction schedule document that I have to highlight dates that are prior to a specified date (the date changes each month). I want to be able to run a javascript to do this. The problem I run into is that some of the dates will have "A" next to them if that activity is complete and these can not be highlighted. 

 

I am not a coder so this is in very simple terms for the two scenarios I need.

 

If "Start Date or Finish Date" < data date;

then highlight date. 

If date contains "A" at the end no highlight. 

 

Date format in the pdf report is 14-Sep-22. Start Date and Finish date fields are all in the same column as well.

Any help would be greatly appreciated as this take up so much of my time each week.

TOPICS
JavaScript

Views

27

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

Hi,

 

I am not sure how you fields are set up, but you should be able to use something like

if ( !datefield.value.match ("A$") ){
// doesn't end with an A so can look to highlight
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

LATEST

Does you form fields for the dates?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines