Skip to content

Instantly share code, notes, and snippets.

@Kalaivanimurugan
Last active December 19, 2017 05:15
Show Gist options
  • Save Kalaivanimurugan/c0c7b7e1294f5a534c07813adc13e2af to your computer and use it in GitHub Desktop.
Save Kalaivanimurugan/c0c7b7e1294f5a534c07813adc13e2af to your computer and use it in GitHub Desktop.
Generate date range based on from and to date in Ruby
from = Date.parse("1-10-2017")
to = Date.parse("30-10-2017")
date_range = (from..to).map { |d| d }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment