fix
This commit is contained in:
18
pkg/util/time.go
Normal file
18
pkg/util/time.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package util
|
||||
|
||||
func CountDaysOfMonth(year int, month int) (days int) {
|
||||
if month != 2 {
|
||||
if month == 4 || month == 6 || month == 9 || month == 11 {
|
||||
days = 30
|
||||
} else {
|
||||
days = 31
|
||||
}
|
||||
} else {
|
||||
if ((year%4) == 0 && (year%100) != 0) || (year%400) == 0 {
|
||||
days = 29
|
||||
} else {
|
||||
days = 28
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user