First off, let me say that this may not be a big deal to most people, but I imagine it'd be useful to a lot. Basically, I have data that various people are tracking that needs to get reported up to senior management. Senior management likes to see pretty trafficlight-style displays - green is good, red is bad; I'm sure you get the idea. I have to do this on several tables, so I plan on implementing this. I'd like some feedback from others, tho...
I'm working off the 3.2 code-base, so I have 11 field types (string, int, boolean, currency, decimal, date, time, date/time, URL, email, and image). For all numeric fields, it's easy - there'll be min and max values. For string, boolean, URL, email, and image I plan on basically just supporting equal and not equal. The problem comes in with the dates and times.
The problem with dates and times is that coloring needs to be relative to a certain date/time. I'm guessing that, 90% of the time, the current day will be used. For instance, if I'm tracking the last renwal of annual licenses, I may want the field to display as red if the renewal is past due, yellow if within 30 days, and green for anything else. For dates, I feel it's pretty safe to assume that I can provide a number based off the date diff from today (yesterday = -1, tomorrow = 1). This is kind of odd logic to parse without seeing it, so I'll try to post an example later (don't have time right now). On to the bigger problem, tho...
Times. I highly doubt anybody will be wanting coloring based on time values, but it's possible. Common sense tells me to do the same as the dates but use hours instead. How does that sound? Now, of course, I know that once this is out there,
somebody is going to want it in minutes. That wouldn't hurt the hours standpoint, but I'd hate to make it overly complicated for those interested in hours if there isn't a need for it.
There are a lot of things I could do to make it so these issues would come up (more robust color picking and comparison options); but I'm not getting paid for this, so if you want it, email me In the meantime, I'd love to hear anyone else's thoughts on this. Does anyone need/want this? I only need coloring on dates right now, but have numeric coloring right around the corner. If anyone has any questions or comments, please let me know. I want to make sure to do this right the first time because it's pretty extensive (for just a color ).
Oh, and by the way, I'm giving bg color, fg color, and CSS class options.