Future date for Rails

I am trying to do a validation that will check that the date entered is in the future and that the selected date is in the next 7 days.

To check if a date will be used in the future,

valid_until.future? 

      

and this file works fine, but to check if a date selected after 7 days is selected?

+2


a source to share


1 answer


valid_until.future? && valid_until < 7.days.since(Time.now).to_date

      



+9


a source







All Articles