Skip to content

Instantly share code, notes, and snippets.

@crova
Created July 12, 2016 07:43
Show Gist options
  • Save crova/a496376c979ca422e7791cc1cd82b4b0 to your computer and use it in GitHub Desktop.
Save crova/a496376c979ca422e7791cc1cd82b4b0 to your computer and use it in GitHub Desktop.
day = Time.current.day
day_to_use = day - 1
month = Time.current.month
#sets number of days within current month
if month == 4 || 6 || 9 || 11
days_within_month = 30
elsif month == 1 || 3 || 5 || 7 || 8 || 10 || 12
days_within_month = 31
else
days_within_month = 28
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment