mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
support setting the last 1 to 3 days of the month to scheduled transaction frequency
This commit is contained in:
@@ -286,6 +286,12 @@ func IsUnixTimeEqualsYearAndMonth(unixTime int64, timezone *time.Location, year
|
||||
return date.Year() == int(year) && int(date.Month()) == int(month)
|
||||
}
|
||||
|
||||
// GetMaxDayOfMonth returns the maximum day of the month for the specified year and month
|
||||
func GetMaxDayOfMonth(year int, month time.Month) int {
|
||||
t := time.Date(year, month+1, 0, 0, 0, 0, 0, time.UTC)
|
||||
return t.Day()
|
||||
}
|
||||
|
||||
// GetTimezoneOffsetMinutes returns offset minutes according specified timezone
|
||||
func GetTimezoneOffsetMinutes(unixTime int64, timezone *time.Location) int16 {
|
||||
_, tzOffset := parseFromUnixTime(unixTime).In(timezone).Zone()
|
||||
|
||||
Reference in New Issue
Block a user