Jump to content
  • 0
Sign in to follow this  
Glitch

Highlight Previous days

Question

4 answers to this question

Recommended Posts

  • 0

Hello @Glitch

 

You may try pasting this code in the Footer section of "Configure Fields for Calendar" of your DataPage Configuration. Do make sure that HTML Editor is Disabled from the Advanced Tab.

<script>
var curr = document.querySelector('.cbResultSetCalendarTableNowCell .cbResultSetCalendarField')
var dates = document.querySelectorAll('[class*=cbResultSetCalendarField')

for (let [idx, elem] of dates.entries()) {

if (elem == curr) break;
elem.parentNode.style.background = "red";
  
}
  
</script>

 

Hope this helps.

DN31337!

Share this post


Link to post
Share on other sites
  • 0

Hello @TroubleShooter,

 

You  may try using this updated code below:

<script>

document.addEventListener('DataPageReady', function() {

var curr = document.querySelector('.cbResultSetCalendarTableNowCell .cbResultSetCalendarField')
var dates = document.querySelectorAll('[class*=cbResultSetCalendarField')


for (let [idx, elem] of dates.entries()) {
if ( !curr || elem == curr) break;
elem.parentNode.style.background = "red";
}

})

</script>

 

This, however only highlights the previous days of the current month you're in.

Share this post


Link to post
Share on other sites

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.

Guest
Answer this question...

×   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.

Loading...
Sign in to follow this  

×
×
  • Create New...