From b60870da8942d7416e4470a8017f187f04211aa2 Mon Sep 17 00:00:00 2001 From: nisin Date: Wed, 21 Apr 2021 22:24:28 +0900 Subject: [PATCH] fix reiwa to heisei Comparing --- Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift b/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift index 5ef2d453..d250a0a1 100644 --- a/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift +++ b/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift @@ -228,6 +228,7 @@ public extension DateInRegion { /// - Returns: new altered `DateInRegion` instance func dateBySet(_ components: [Calendar.Component: Int?]) -> DateInRegion? { var dateComponents = DateComponents() + dateComponents.era = (components[.era] ?? era) dateComponents.year = (components[.year] ?? year) dateComponents.month = (components[.month] ?? month) dateComponents.day = (components[.day] ?? day)