mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-11 04:34:55 -06:00
15 lines
486 B
Swift
15 lines
486 B
Swift
import Foundation
|
|
|
|
extension Date {
|
|
// MARK: Methods
|
|
|
|
/// Returns a date that is set to midnight on the day that is seven days in the future.
|
|
///
|
|
static func midnightOneWeekFromToday() -> Date? {
|
|
let calendar = Calendar.current
|
|
guard let date = calendar.date(byAdding: .day, value: 7, to: Date()) else { return nil }
|
|
guard let date = calendar.date(bySettingHour: 0, minute: 0, second: 0, of: date) else { return nil }
|
|
return date
|
|
}
|
|
}
|