Skip to content

Instantly share code, notes, and snippets.

@vanakenm
Created January 13, 2015 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanakenm/11839af65f0111d7cc8b to your computer and use it in GitHub Desktop.
Save vanakenm/11839af65f0111d7cc8b to your computer and use it in GitHub Desktop.
Days since Christmas
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