Add class for a date field I have a  content type "Task" with a Date field to define a deadline for tasks. What I'm trying to do is to add an extra css class to the field wrapper to indicate that today is the deadline. I can do it with JQuery, but its stupid...

So i'd like create a function in my custom module which checks the field date, compares it with today date and if it results that today is a deadline (or the deadline already past), adds an extra class to the wrapper.

Will be very appreciate for any help or advice.
this might be what are looking for Adding CSS Classes to Fields in Drupal


  Implementing any type of modular CSS requires fine grain control over
  classes in your HTML. In my last post, we looked at how we can easily
  add classes to blocks in Drupal using preprocess functions. Now let's
  apply the same technique to fields. Fields are a fundamental building
  block of any Drupal 7 site. Fields contain content and content is
  king. Before we dig in and start classing up our fields, let's look at
  how they are rendered to the screen.