diff --git a/Linphone.xcodeproj/project.pbxproj b/Linphone.xcodeproj/project.pbxproj index c7eb30245..51b076f89 100644 --- a/Linphone.xcodeproj/project.pbxproj +++ b/Linphone.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 6613A0B02BAEB7F4008923A4 /* MeetingsListFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6613A0AF2BAEB7F4008923A4 /* MeetingsListFragment.swift */; }; 6613A0B42BAEBE3F008923A4 /* MeetingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6613A0B32BAEBE3F008923A4 /* MeetingViewModel.swift */; }; 66162A202BDFC2F900DCE913 /* AddParticipantsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66162A1F2BDFC2F900DCE913 /* AddParticipantsViewModel.swift */; }; + 66246C6A2C622AE900973E97 /* TimeZoneExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66246C692C622AE900973E97 /* TimeZoneExtension.swift */; }; 662B69D92B25DE18007118BF /* TelecomManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662B69D82B25DE18007118BF /* TelecomManager.swift */; }; 662B69DB2B25DE25007118BF /* ProviderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662B69DA2B25DE25007118BF /* ProviderDelegate.swift */; }; 6646A7A32BB2E224006B842A /* ScheduleMeetingFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6646A7A22BB2E224006B842A /* ScheduleMeetingFragment.swift */; }; @@ -195,6 +196,7 @@ 6613A0AF2BAEB7F4008923A4 /* MeetingsListFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetingsListFragment.swift; sourceTree = ""; }; 6613A0B32BAEBE3F008923A4 /* MeetingViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MeetingViewModel.swift; sourceTree = ""; }; 66162A1F2BDFC2F900DCE913 /* AddParticipantsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddParticipantsViewModel.swift; sourceTree = ""; }; + 66246C692C622AE900973E97 /* TimeZoneExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeZoneExtension.swift; sourceTree = ""; }; 662B69D82B25DE18007118BF /* TelecomManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TelecomManager.swift; sourceTree = ""; }; 662B69DA2B25DE25007118BF /* ProviderDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProviderDelegate.swift; sourceTree = ""; }; 6646A7A22BB2E224006B842A /* ScheduleMeetingFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScheduleMeetingFragment.swift; sourceTree = ""; }; @@ -395,6 +397,7 @@ C6DC4E3C2C199C4E009096FD /* BundleExtenion.swift */, C628172D2C1C3A3600DBA646 /* AccountExtension.swift */, C62817312C1C400A00DBA646 /* StringExtension.swift */, + 66246C692C622AE900973E97 /* TimeZoneExtension.swift */, ); path = Extensions; sourceTree = ""; @@ -1127,6 +1130,7 @@ D72343322ACEFF58009AA24E /* QRScannerController.swift in Sources */, 662B69D92B25DE18007118BF /* TelecomManager.swift in Sources */, D72343342ACEFFC3009AA24E /* QRScanner.swift in Sources */, + 66246C6A2C622AE900973E97 /* TimeZoneExtension.swift in Sources */, 66C491FB2B24D32600CEA16D /* CoreExtension.swift in Sources */, D7F5F6412C359F3B007FCF2F /* SipAddressesPopup.swift in Sources */, D72A9A052B9750A1000DC093 /* UIList.swift in Sources */, diff --git a/Linphone/Utils/Extensions/TimeZoneExtension.swift b/Linphone/Utils/Extensions/TimeZoneExtension.swift new file mode 100644 index 000000000..3be68d124 --- /dev/null +++ b/Linphone/Utils/Extensions/TimeZoneExtension.swift @@ -0,0 +1,16 @@ +// +// TimeZoneExtension.swift +// Linphone +// +// Created by QuentinArguillere on 06/08/2024. +// + +import Foundation + +extension TimeZone { + // Format timezone identifier as a string of the form : GMT{+,-}[-12, 12]:00 - {Identifier} + func formattedString() -> String { + let gmtOffset = self.secondsFromGMT()/3600 + return "GMT\(gmtOffset >= 0 ? "+" : "")\(gmtOffset):00 - \(self.identifier)" + } +}