Skip to content

Instantly share code, notes, and snippets.

@2get
Created April 30, 2014 06:21
Show Gist options
  • Save 2get/9e0299736f20a7ae1bb6 to your computer and use it in GitHub Desktop.
Save 2get/9e0299736f20a7ae1bb6 to your computer and use it in GitHub Desktop.
指定された曜日名に対する曜日 (0-6, Sunday is zero) を返す
# 指定された曜日名に対する曜日 (0-6, Sunday is zero) を返す
# Example:
# WDAY('Sunday')
# # => 0
def WDAY(day_name)
Date.parse(day_name).wday
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment