author avatar

manu

Thu Aug 10 2017

Finding the last Sunday in rails.

d = DateTime.now
sunday = d - d.wday

d.wday gives the weekday starting from 0.