Created
September 17, 2018 16:40
-
-
Save vialyx/61143e2662b36f38ed93b5b0b61431d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let startOfDay = Calendar.current.startOfDay(for: Date()) | |
let dateInterval = DateInterval(start: startOfDay, duration: 8 * 60 * 60) | |
let meetingDate = startOfDay + 13 * 60 * 60 | |
print("Are we have a meeting today?: \(dateInterval.contains(meetingDate))") | |
// Are we have a meeting today?: false | |
// Yeah! Today a good day for productive work without meetings! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment