Swiftfin/Shared/Extensions/JellyfinAPI/DayOfWeek.swift
Joe c46ee13dbc
Some checks are pending
Build 🔨 / Build 🔨 (Swiftfin tvOS) (push) Waiting to run
Build 🔨 / Build 🔨 (Swiftfin) (push) Waiting to run
[iOS] Admin Dashboard - Add/Delete Task Triggers (#1276)
* All Working. TODO: Figure out why TimeInterval crashes Swiftfin if I select 'Cancel'

* Cleanup. Kind of a typeAlias but not really? Fixed the minute crash, I was make a recursive calc. All good now. Make sure temp values default to existing value at startup

* Manual Run action from Edit View

* Issues resolved.

* Labels / soft merge with Main

* Utilize events to print a success/failure message for when there is an attempted change with a TaskTrigger.

* Fix label wrong value & remove TODO for completed item.

* Fix all the merge issues.

* wip

* wip

* localize

---------

Co-authored-by: Ethan Pippin <ethanpippin2343@gmail.com>
2024-10-23 16:30:12 -06:00

26 lines
664 B
Swift

//
// Swiftfin is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
//
import Foundation
import JellyfinAPI
extension DayOfWeek {
var displayTitle: String? {
let newLineRemoved = rawValue.replacingOccurrences(of: "\n", with: "")
guard let index = DateFormatter().weekdaySymbols.firstIndex(of: newLineRemoved) else {
return nil
}
return Calendar.current
.weekdaySymbols[index]
.localizedCapitalized
}
}