Skip to content

Commit d5ffbe3

Browse files
Improve highlightToday_sEntry() to support new month's eve
1 parent 62d9fd8 commit d5ffbe3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sheets/main.gs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ function highlightToday_sEntry()
4747
let sheet = ss.getSheets()[new Date().getMonth() + 1];
4848
let dd = 2 + new Date().getDate();
4949

50-
sheet.getRange(dd-1, 1).setBackgroundRGB(255, 255, 255)
50+
if(dd == (2 + 1)){
51+
let sheet_old = ss.getSheets()[new Date().getMonth() + 1 - 1];
52+
sheet_old.getRange("A31:A33").clearFormat(); // ranges from the 29th to the 31st day of the month
53+
} else {
54+
sheet.getRange(dd-1, 1).clearFormat();
55+
}
56+
5157
sheet.getRange(dd, 1).setBackgroundRGB(255, 255, 0);
5258
}
5359

0 commit comments

Comments
 (0)