WIP: Fix precise ban timer (?)

This commit is contained in:
Kylmakalle 2025-02-05 15:14:40 +02:00
parent 1405e26da3
commit 3b71399019

View File

@ -68,7 +68,7 @@ private final class PeerBanTimeoutActionSheetItem: ActionSheetItem {
init(strings: PresentationStrings, currentValue: Int32, valueChanged: @escaping (Int32) -> Void) {
self.strings = strings
self.currentValue = roundDateToDays(currentValue)
self.currentValue = /*roundDateToDays(*/currentValue/*)*/
self.valueChanged = valueChanged
}
@ -97,7 +97,7 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode {
self.pickerView = UIDatePicker()
self.pickerView.datePickerMode = .countDownTimer
self.pickerView.datePickerMode = .dateAndTime
self.pickerView.date = Date(timeIntervalSince1970: Double(roundDateToDays(currentValue)))
self.pickerView.date = Date(timeIntervalSince1970: Double(/*roundDateToDays(*/currentValue/*)*/))
self.pickerView.locale = localeWithStrings(strings)
self.pickerView.minimumDate = Date()
self.pickerView.maximumDate = Date(timeIntervalSince1970: Double(Int32.max - 1))
@ -122,6 +122,6 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode {
}
@objc private func datePickerUpdated() {
self.valueChanged(roundDateToDays(Int32(self.pickerView.date.timeIntervalSince1970)))
self.valueChanged(/*roundDateToDays(*/Int32(self.pickerView.date.timeIntervalSince1970)/*)*/)
}
}