Tuesday 15 March 2011

ruby - Iterating through Dates in Rails -


I am writing a method that uses the date according to a start and end date, and I Date is required. Something like this:

  start_date = 2013/03/12 end_date = 2013/11/20 # start_date to end_date. F | Can anybody please help me with this?  

I have read this question, but they did not indicate how the date has been fixed. Repetition is in progress.

What are you looking for? Use range operator .

  start_date = Date.parse ('2013-03-12') end_date = Date.parse ('2013-11-20 ') (Start_date..end_date) .each Do. Day | | End of the day    

No comments:

Post a Comment