Compare Dates

//MARK: COMPARE DATES func isToday( _ startDate: Date, _ endDate: Date) -> Bool { //Components Date let componentStart = Calendar.current.dateComponents([.year, .month, .day], from: startDate) let componentEnd = Calendar.current.dateComponents([.year, .month, .day], from: endDate) if componentStart.day == componentEnd.day && componentStart.month == componentEnd.month && componentStart.year == componentEnd.year { return true } else { return false } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.