mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-13 18:23:19 +01:00
25 lines
562 B
Swift
25 lines
562 B
Swift
//
|
|
// Calendar+RSCore.swift
|
|
// RSCore
|
|
//
|
|
// Created by Nate Weaver on 2020-01-01.
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public extension Calendar {
|
|
|
|
/// A cached `.autoupdatingCurrent` for performance.
|
|
static let cached: Calendar = .autoupdatingCurrent
|
|
|
|
/// Determine whether a date is in today.
|
|
///
|
|
/// - Parameter date: The specified date.
|
|
///
|
|
/// - Returns: `true` if `date` is in today; `false` otherwise.
|
|
static func dateIsToday(_ date: Date) -> Bool {
|
|
return cached.isDateInToday(date)
|
|
}
|
|
}
|