views:

583

answers:

1

Hey, I'm having trouble with the time portion of the Calendar Date Select gem. The following code limits the date to any day after/greater than today. I need to do this for time, limiting the user to a time that is 24 hours or greater than from now. I can't figure out if the code used in the :valid_date_check is SQL, or Javascript or what. Google and IRC can't figure it out either. Does anyone either have experience with this gem, and had success doing this, or know what the code is so I can go about implementing it myself.

<%= calendar_date_select_tag "time", "", :popup => :force, :time => true, :valid_date_check => "date > (new Date()).stripTime()" %>
+1  A: 

It should be Javascript. It is certainly not Ruby or SQL as they don't use new Date(). Also, :valid_date_check looks to be a pointer to a javascript check to run to validate the date on the client side.

Sometime seeing the actual HTML generated can help with this. If the code is in the HTML then you know it is Javascript.

Kathy Van Stone