Added tests for the Amiibo live client and ISO transcoder.
This commit is contained in:
1 parent
c031fdcc97
commit
8fa4d50734
4 files changed
+588
No files matched your search
@@ -0,0 +1,44 @@
|
||||
// ===----------------------------------------------------------------------===
|
||||
//
|
||||
// This source file is part of the Amiibo Service open source project
|
||||
//
|
||||
// Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors
|
||||
// Licensed under Apache license v2.0
|
||||
//
|
||||
// See LICENSE for license information
|
||||
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// ===----------------------------------------------------------------------===
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Date {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
/// Makes a date from UTC components.
|
||||
static func utc(
|
||||
_ year: Int,
|
||||
_ month: Int,
|
||||
_ day: Int,
|
||||
_ hour: Int = 0,
|
||||
_ minute: Int = 0,
|
||||
_ second: Int = 0
|
||||
) -> Date {
|
||||
var calendar = Calendar(identifier: .gregorian)
|
||||
|
||||
calendar.timeZone = .init(secondsFromGMT: 0)!
|
||||
|
||||
return calendar.date(from: .init(
|
||||
year: year,
|
||||
month: month,
|
||||
day: day,
|
||||
hour: hour,
|
||||
minute: minute,
|
||||
second: second
|
||||
))!
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user