From 811b9e3cda9c9524a490f5178d91ae3eac3300b5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Lapersonne Date: Thu, 30 Dec 2021 14:14:07 +0100 Subject: [PATCH 1/2] fix: #162 - missing tag management for kids first dose See #162 #165 1% release shows the app is not working because of unmanaged tag in daily slots. Signed-off-by: Pierre-Yves Lapersonne --- ViteMaDose/Models/DailySlot.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/ViteMaDose/Models/DailySlot.swift b/ViteMaDose/Models/DailySlot.swift index 85c78b27..9f861e87 100644 --- a/ViteMaDose/Models/DailySlot.swift +++ b/ViteMaDose/Models/DailySlot.swift @@ -41,6 +41,7 @@ extension SlotsPerCategory { case all case firstOfSecondDose = "first_or_second_dose" case thirdDose = "third_dose" + case kidsFirstDose = "kids_first_dose" case unknown = "unknown_dose" } } From 907eebfb6b0ece17d758e8658a582b15e15ac158 Mon Sep 17 00:00:00 2001 From: Nathan Fallet Date: Thu, 30 Dec 2021 14:39:33 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20Fix=20MaPharma=20time=20(#103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ Fix MaPharma time * ✨ Smarter fix * Fixing documentation --- ViteMaDose/Helpers/Extensions/String+Commons.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ViteMaDose/Helpers/Extensions/String+Commons.swift b/ViteMaDose/Helpers/Extensions/String+Commons.swift index a207a326..738796b1 100644 --- a/ViteMaDose/Helpers/Extensions/String+Commons.swift +++ b/ViteMaDose/Helpers/Extensions/String+Commons.swift @@ -17,9 +17,18 @@ extension String { /// This function will try to parse the `String` as a Date /// using `SwiftDate`. /// If parsing fails, it will try to parse as an `ISO` date as a fallback - /// - Parameter region: custom option `Region` - /// - Returns: optional `Date` + /// - Parameters: + /// - style: custom `DateToStringStyles` + /// - region: custom option `Region` + /// - Returns: optional `String` func toString(with style: DateToStringStyles, region: Region) -> String? { + // Fix #102: If it is a timezoned date and the timezone is not specified + if contains("T") && !contains("+") { + // Add missing timezone + let diff = region.timeZone.secondsFromGMT() / 3600 // 1 or 2 depending on summer or winter time + return (self + "+0\(diff):00").toString(with: style, region: region) + } + let date = toDate(nil, region: region) ?? toISODate(nil, region: region) return date?.toString(style) }