23 lines
493 B
Swift
23 lines
493 B
Swift
//
|
|
// Date+extensions.swift
|
|
// FluxRead
|
|
//
|
|
// Created by RSA on 30/11/2025.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Date {
|
|
static func firstDayOfMonth(year: Int, month: Int, calendar: Calendar = .current) -> Date? {
|
|
var components = DateComponents()
|
|
components.year = year
|
|
components.month = month
|
|
components.day = 1
|
|
components.hour = 0
|
|
components.minute = 0
|
|
components.second = 0
|
|
|
|
return calendar.date(from: components)
|
|
}
|
|
}
|