Created
April 30, 2014 06:21
-
-
Save 2get/9e0299736f20a7ae1bb6 to your computer and use it in GitHub Desktop.
指定された曜日名に対する曜日 (0-6, Sunday is zero) を返す
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
# 指定された曜日名に対する曜日 (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