Files
ezbookkeeping/pkg/validators/fiscal_year_start_date.go
2025-06-07 22:13:34 +08:00

20 lines
441 B
Go

package validators
import (
"github.com/go-playground/validator/v10"
"github.com/mayswind/ezbookkeeping/pkg/core"
)
// ValidateFiscalYearStart validates if a fiscal year start date is valid
func ValidateFiscalYearStart(fl validator.FieldLevel) bool {
date, ok := fl.Field().Interface().(core.FiscalYearStart)
if !ok {
return false
}
// Use the core functionality to validate
_, _, err := date.GetMonthDay()
return err == nil
}