Revert "mute: adding new structs/enums for new mute list"
This reverts commit 50f45288ce.
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// DamusDuration.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Charlie Fish on 1/13/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum DamusDuration: CaseIterable {
|
||||
case day
|
||||
case week
|
||||
case month
|
||||
|
||||
var title: String {
|
||||
switch self {
|
||||
case .day:
|
||||
return NSLocalizedString("24 hours", comment: "A duration of 24 hours/1 day to be shown to the user. Most likely in the context of how long they want to mute a piece of content for.")
|
||||
case .week:
|
||||
return NSLocalizedString("1 week", comment: "A duration of 1 week to be shown to the user. Most likely in the context of how long they want to mute a piece of content for.")
|
||||
case .month:
|
||||
return NSLocalizedString("1 month", comment: "A duration of 1 month to be shown to the user. Most likely in the context of how long they want to mute a piece of content for.")
|
||||
}
|
||||
}
|
||||
|
||||
var date_from_now: Date? {
|
||||
let current_date = Date()
|
||||
|
||||
switch self {
|
||||
case .day:
|
||||
return Calendar.current.date(byAdding: .day, value: 1, to: current_date)
|
||||
case .week:
|
||||
return Calendar.current.date(byAdding: .day, value: 7, to: current_date)
|
||||
case .month:
|
||||
return Calendar.current.date(byAdding: .month, value: 1, to: current_date)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user