2
votes

I'm creating a View that will be shown within a Block. Each Node being pulled into the View has a time value associated to it (this is actually an integer between 0 and 2399 as Drupal doesn't support time only values). As a filter in the View I only want to show events that have yet to happen on that day. So i want the eventtime > CURTIME() in the filter. However Drupal seems to be stripping out the MySQL function and turning it into 0. Is there a way I can get it to leave it alone?

1
Need a bit more info to help you on this. Where is the time value coming from --- I gather you're probably not using CCK Date since its filters support php time comparisons, so what are you using instead? - anschauung
I am using CCK but opted to use a select list of values 0 -> 2330 (labelled 12am to 1130pm) for the time value. There's no time only widget and a year is required even if you don't make it visible. So if you added two events: one at 12 noon in 2011 and another at 11 am in 2012, the 2011 event would show up first. Anyway, I just want to take events that occur after then current time (CURTIME() / 100 would return a value I could compare to 0 -> 2330) - rob5408

1 Answers

0
votes

If this is related to your question about events & repeating dates, I think a daily event that repeats how you choose might be better than this but whatever.

To maintain custom SQL in a filter you could use this with caution (and some PHP skill):

http://drupal.org/project/viewsphpfilter

Here are some some usage examples:

http://drupal.org/node/690670