generated from semicolondsm/Semicolon_Repository_Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ย :: (#519) notificationList bug fix
- Loading branch information
Showing
4 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Foundation | ||
|
||
extension Int { | ||
func monthToDate(date: Date) -> Int { | ||
switch self { | ||
case 1, 3, 5, 7, 8, 10, 12: | ||
return 31 | ||
case 4, 6, 9, 11: | ||
return 30 | ||
default: | ||
if Calendar.current.dateComponents([.year], from: date).isLeapMonth! { | ||
return 29 | ||
} else { | ||
return 28 | ||
} | ||
} | ||
} | ||
} |
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