-
-
Save makshark/e55cffbb4e58ee17e30d to your computer and use it in GitHub Desktop.
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
def self.set_range(date = 26) | |
range = Range.new | |
if Date.today.strftime('%d') < date | |
start_date = Date.new((Date.today - 1.month).strftime('%Y').to_i,(Date.today - 1.month).strftime('%m').to_i, 26) | |
end_date = Date.new((Date.today).strftime('%Y').to_i,(Date.today).strftime('%m').to_i, 26) | |
range = start_date..end_date | |
else | |
end | |
range | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment