Logo

Programming-Idioms

Create list r and initialize it with the first date of the current month up to the last date of the current month.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
require 'date'
today = Date.today
y, m = today.year, today.month
r = (Date.new(y, m, 1) .. Date.new(y, m, -1)).to_a