|
|
|
|
@ -80,7 +80,12 @@ class FederalPlayer: Decodable { |
|
|
|
|
|
|
|
|
|
let ageSportif = try container.decodeIfPresent(Int.self, forKey: .ageSportif) |
|
|
|
|
if let ageSportif { |
|
|
|
|
birthYear = Calendar.current.component(.year, from: Date()) - ageSportif |
|
|
|
|
let month = Calendar.current.component(.month, from: Date()) |
|
|
|
|
if month > 8 { |
|
|
|
|
birthYear = Calendar.current.component(.year, from: Date()) + 1 - ageSportif |
|
|
|
|
} else { |
|
|
|
|
birthYear = Calendar.current.component(.year, from: Date()) - ageSportif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
clubCode = try container.decodeIfPresent(String.self, forKey: .codeClub) ?? "" |
|
|
|
|
club = try container.decodeIfPresent(String.self, forKey: .nomClub) ?? "" |
|
|
|
|
|