Currently this is helper for getting a datetime selector in a form.
I want to improve it by showing only the next 14 days as options. Is this possible?
Thanks in advance!
def begins_at_for form
options = {
:start_year => Time.now.utc.year,
:end_year => Time.now.utc.year,
:discard_year => true,
:default => 3.days.from_now,
:use_short_month => true,
:minute_step => 15,
:include_seconds => false
}
if Time.now.utc.yday > 300
options.merge!( :end_year => Time.now.utc.year + 1 )
end
form.datetime_select(
:begins_at,
options
)
end
Use jquery and this datepicker. You can disable days on the calendar, so you could disable all but the next 14 days to do what you want.
http://www.eyecon.ro/datepicker/