Created
April 14, 2021 12:29
-
-
Save wneessen/f644f22949b174e2507b42d711115eb7 to your computer and use it in GitHub Desktop.
Check if date is first of quarter or semester
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
func IsFirstOfQuarter(t time.Time) bool { | |
dateString := t.Format("01-02") | |
if dateString == "01-01" || | |
dateString == "04-01" || | |
dateString == "07-01" || | |
dateString == "10-01" { | |
return true | |
} | |
return false | |
} | |
func IsFirstOfSemester(t time.Time) bool { | |
dateString := t.Format("01-02") | |
if dateString == "01-01" || | |
dateString == "06-01" { | |
return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment