Skip to content

Commit

Permalink
曜日の英語表記を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiyasac committed Dec 29, 2016
1 parent 7660ee7 commit 0f7f550
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions CalculateCalendarLogic/CalculateCalendarLogic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum Weekday: Int {
self.init(rawValue: weekdayNum - 1)
}

//曜日の表記(日,月,火,水,木,金,土の表記)
var shortName: String {
switch self {
case .sun: return ""
Expand All @@ -37,14 +38,42 @@ public enum Weekday: Int {
case .sat: return ""
}
}


//曜日の表記(○曜の表記)
var mediumName: String {
return shortName + ""
}


//曜日の表記(○曜日の表記)
var longName: String {
return shortName + "曜日"
}

//曜日の英語表記(略したもの)
var englishName: String {
switch self {
case .sun: return "Sun"
case .mon: return "Mon"
case .tue: return "Tue"
case .wed: return "Wed"
case .thu: return "Thu"
case .fri: return "Fri"
case .sat: return "Sat"
}
}

//曜日の英語表記(完全スペルのもの)
var englishLongName: String {
switch self {
case .sun: return "Sunday"
case .mon: return "Monday"
case .tue: return "Tuesday"
case .wed: return "Wednesday"
case .thu: return "Thursday"
case .fri: return "Friday"
case .sat: return "Saturday"
}
}
}

public struct CalculateCalendarLogic {
Expand Down
Binary file not shown.

0 comments on commit 0f7f550

Please sign in to comment.