Check date with current day

Check date with current day

m75sam75sa Posts: 132Questions: 30Answers: 0

Considering this example:
live.datatables.net/nutotaha/1/edit

do you think is possible to check where the date is the current date (i.e today) and if today change the color of the grouped row?

for example, if the grouped row date is today, the text will be red, otherwise will be black...

Possible with datatable?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You could do something like this - http://live.datatables.net/nutotaha/2/edit

    It's hard coded in that example, you just need to work out what the matching criteria is for your dates,

    Colin

  • m75sam75sa Posts: 132Questions: 30Answers: 0
    edited February 2022

    great Colin, thanks. Is there a way to have the current date instead of compare with a static date? In php i use the date function... here?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Have a look at the JS Date object,

    Colin

Sign In or Register to comment.