Skip to content

Commit

Permalink
Merge pull request #166 from CovidTrackerFr/develop
Browse files Browse the repository at this point in the history
fix: #162 #103 - mapharma time and bug with unmanaged tag for kids first dose
  • Loading branch information
nathanfallet authored Dec 30, 2021
2 parents bab0f5b + 907eebf commit 77dc64f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ViteMaDose/Helpers/Extensions/String+Commons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions ViteMaDose/Models/DailySlot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down

0 comments on commit 77dc64f

Please sign in to comment.