0
votes

I need my date select form field to show users only the future dates (like for eg. today is 7 apr 2016, then it must show all dates beyond 7 apr 2016) and for month field it must only show the current month,year(any)

 <%= f.date_select :start_date,class: 'form-control'%>

Date picker

Year: any

Date: only future dates

Month: the current ongoing month

1

1 Answers

0
votes

There are two ways:

Using date_select you only have the option of restricting the starting year but not month and day. http://apidock.com/rails/v3.2.1/ActionView/Helpers/DateHelper/date_select

<%= f.date_select :start_date, start_year: Date.today.year, class: 'form-control'%>