Skip to content

Instantly share code, notes, and snippets.

@weslleyaraujo
Last active December 26, 2015 18:39
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 weslleyaraujo/7196500 to your computer and use it in GitHub Desktop.
Save weslleyaraujo/7196500 to your computer and use it in GitHub Desktop.
def date_to_unix(time)
Time.parse(time).to_i
end
def in_progress(start_time, end_time, time_now = (Time.new.strftime '%d/%m/%Y'))
now = date_to_unix(time_now)
if date_to_unix(start_time) <= now
date_to_unix(end_time) < now ? false : true
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment