Skip to content

Commit 2272317

Browse files
committed
refactor: follow naming conventions
> Follow case conventions. Names of types and protocols are UpperCamelCase. Everything else is lowerCamelCase. https://www.swift.org/documentation/api-design-guidelines/#conventions
1 parent 25424bd commit 2272317

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Sources/HolidayJp/HolidayJp.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class HolidayJp {
1212

1313
public static let calendar: Calendar = Calendar(identifier: .iso8601)
1414

15-
public static let Holidays: [String: Holiday] = HolidayJSONLoader.loadHolidays(bundle: Bundle.module)
15+
public static let holidays: [String: Holiday] = HolidayJSONLoader.loadHolidays(bundle: Bundle.module)
1616

1717
public static func between(
1818
_ start: Date,
@@ -24,7 +24,7 @@ public class HolidayJp {
2424
let startYmd = String(format: "%04d-%02d-%02d", startComponents.year!, startComponents.month!, startComponents.day!)
2525
let endYmd = String(format: "%04d-%02d-%02d", endComponents.year!, endComponents.month!, endComponents.day!)
2626

27-
return Holidays
27+
return holidays
2828
.filter { ymd, _ in startYmd <= ymd && ymd <= endYmd }
2929
.values
3030
.sorted(by: { $0.ymd < $1.ymd })
@@ -33,11 +33,11 @@ public class HolidayJp {
3333
public static func isHoliday(_ date: Date, calendar: Calendar = HolidayJp.calendar) -> Bool {
3434
let components = calendar.dateComponents([.year, .month, .day], from: date)
3535
let ymd = String(format: "%04d-%02d-%02d", components.year!, components.month!, components.day!)
36-
return Holidays[ymd] != nil
36+
return holidays[ymd] != nil
3737
}
3838

3939
public static func isHoliday(year: Int, month: Int, day: Int) -> Bool {
4040
let ymd = String(format: "%04d-%02d-%02d", year, month, day)
41-
return Holidays[ymd] != nil
41+
return holidays[ymd] != nil
4242
}
4343
}

0 commit comments

Comments
 (0)