rajeevkannav
unread,Jan 13, 2011, 6:25:31 AM1/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to calendar_date_select
I have this method in my application helper
def date_selector(field_name, value, opts = { })
if value.blank? and !opts[:no_eg_text]
value = Invitation::DATE_TEMPLATE_TEXT
style = 'color: #BBBBBB;'
else
value = (value.strftime("%m/%d/%Y %I:%M %p") rescue '') unless
value.is_a?(String)
style = ''
end
use_opts = {:time => true,
:class => 'fatinput',
:start_year => Time.now.year,
:before_close => 'catcalc(\'' + field_name + '\');',
:style => style }.merge(opts)
opts[:class] << " fieldWithErrors" if opts[:error]
calendar_date_select_tag(field_name, value, use_opts)
end
In Views this
<%= date_selector('object[end_time_local]',
@object.end_time_local,
:disabled => (@object.posted? and @object.recurring?),
:class => 'edit_time_fields',
:error => @object.date_errors?)%>
How can i disable all the dates before today ?
Thanks in advance