I want to make a maximum input for time with format time like (23:30:00) and the maximum time is (09:30:00), i tried the validation using ozzo validation and i find the function and its call "Date(layout string)"
It is the documentation https://github.com/go-ozzo/ozzo-validation
From the documentation i see that the function Date has Min and Max to check specified range but the problem is i don't know how to fill the arguments. The data type is time.Time.
Here is my code
if err := validation.Validate(c.ReleasedTime, validation.Date("15:04:05").Max(????)); err != nil {
logger.E(err)
return shared.NewMultiStringValidationError(shared.HTTPErrorBadRequest, map[string]string{
"en": "Format date",
"id": "format tanggal",
})
}
From there i fill the Max arguments "???" because i still confuse how to fill it. Maybe you all can help me to find the this solution or make this validation using another package, i'll be appreciated. Thank you