From 225f886d4aaceef0363a4022084981c1eac75d18 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 19 Oct 2020 01:06:57 +0400 Subject: [PATCH] Fix more date pickers --- .../Sources/DateSelectionActionSheetController.swift | 2 +- submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift | 2 +- .../Themes/ThemeAutoNightTimeSelectionActionSheet.swift | 2 +- submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift index cd1b21738f..f4db5b0839 100644 --- a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift +++ b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift @@ -105,7 +105,6 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode { self.pickerView = UIDatePicker() self.pickerView.timeZone = TimeZone(secondsFromGMT: 0) - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.date = Date(timeIntervalSince1970: Double(roundDateToDays(currentValue))) @@ -121,6 +120,7 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode { } else { self.pickerView.maximumDate = Date(timeIntervalSince1970: Double(Int32.max - 1)) } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift index 50c71a9558..0455560d5b 100644 --- a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift +++ b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift @@ -94,7 +94,6 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode { self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.date = Date(timeIntervalSince1970: Double(roundDateToDays(currentValue))) @@ -104,6 +103,7 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode { if #available(iOS 13.4, *) { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift index 3edd0efda9..0a670a83d6 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift @@ -99,7 +99,6 @@ private final class ThemeAutoNightTimeSelectionActionSheetItemNode: ActionSheetI self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .time self.pickerView.timeZone = TimeZone(secondsFromGMT: 0) @@ -108,6 +107,7 @@ private final class ThemeAutoNightTimeSelectionActionSheetItemNode: ActionSheetI if #available(iOS 13.4, *) { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift index 06d77d87a5..7e646caf52 100644 --- a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift +++ b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift @@ -84,7 +84,6 @@ private final class ChatDateSelectorItemNode: ActionSheetItemNode { self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.locale = Locale(identifier: strings.baseLanguageCode) @@ -96,6 +95,8 @@ private final class ChatDateSelectorItemNode: ActionSheetItemNode { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") + super.init(theme: theme) self.view.addSubview(self.pickerView)