Ask A Question
You’re not receiving notifications from this thread.
How do I display just the year in a sect date?
Rob Thomas asked in Rails • Solved
Good day Rails Devs,
What's the proper way to dsiplay just the year in:
<%= form.date_select :year %>
There are a couple options called
discard_month that you could set to true to hide them and only display the year. All the options are listed here: https://api.rubyonrails.org/v5.2.1/classes/ActionView/Helpers/DateHelper.html#method-i-date_select
Got it, thanks Chris!
<%= form.date_select :year, :discard_day => true, :discard_month => true, class: 'form-control' %>