You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
545 B
24 lines
545 B
//
|
|
// Date+Ext.swift
|
|
// GME Remit
|
|
//
|
|
// Created by InKwon James Kim on 15/07/2019.
|
|
// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Date {
|
|
static func - (lhs: Date, rhs: Date) -> Int? {
|
|
let calendar = Calendar.current
|
|
|
|
let startDate = calendar.startOfDay(for: rhs)
|
|
let endDate = calendar.startOfDay(for: lhs)
|
|
|
|
guard let remindDay = calendar.dateComponents([.day], from: startDate, to: endDate).day else {
|
|
return nil
|
|
}
|
|
|
|
return remindDay
|
|
}
|
|
}
|