support setting the last 1 to 3 days of the month to scheduled transaction frequency

This commit is contained in:
MaysWind
2026-04-13 00:06:45 +08:00
parent 0222f61da6
commit d7151bc7ab
26 changed files with 148 additions and 32 deletions
+6
View File
@@ -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()