Created
January 13, 2015 16:48
-
-
Save vanakenm/11839af65f0111d7cc8b to your computer and use it in GitHub Desktop.
Days since Christmas
This file contains hidden or 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
require 'date' | |
def xmas_count | |
if Time.now.month == 12 && Time.now.day >= 25 | |
(Date.today - Date.new(Time.now.year, 12, 25)).to_i | |
else | |
(Date.today - Date.new(Time.now.year-1, 12, 25)).to_i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment