I made new object Date.new with args (year, month). After create ruby added 01 number of day to this object by default. Is there any way to add not first day, but last day o
You can do something like that:
def last_day_of_month? (Time.zone.now.month + 1.day) > Time.zone.now.month end Time.zone.now.day if last_day-of_month?