-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new extensions and modify readme
- Loading branch information
SimonL
committed
Jul 19, 2019
1 parent
5748787
commit c75a874
Showing
8 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
29 changes: 20 additions & 9 deletions
29
...Pods.xcodeproj/xcuserdata/simon.xcuserdatad/xcschemes/Pods-TymateSwiftExtensions.xcscheme
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
Pods/Pods.xcodeproj/xcuserdata/simon.xcuserdatad/xcschemes/xcschememanagement.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+5.86 KB
(130%)
...teSwiftExtensions.xcworkspace/xcuserdata/simon.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// DateExtensions.swift | ||
// TymateSwiftExtensions | ||
// | ||
// Created by Simon on 19/07/2019. | ||
// Copyright © 2019 Tymate. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Date { | ||
func days(between otherDate: Date) -> Int { | ||
let calendar = Calendar.current | ||
|
||
let startOfSelf = calendar.startOfDay(for: self) | ||
let startOfOther = calendar.startOfDay(for: otherDate) | ||
let components = calendar.dateComponents([.day], from: startOfSelf, to: startOfOther) | ||
|
||
return abs(components.day ?? 0) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters