Last active
December 19, 2017 05:15
-
-
Save Kalaivanimurugan/c0c7b7e1294f5a534c07813adc13e2af to your computer and use it in GitHub Desktop.
Generate date range based on from and to date in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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