mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 12:02:27 +08:00
10 lines
307 B
Go
10 lines
307 B
Go
package service
|
|
|
|
import "time"
|
|
|
|
// isJSONTimeInRange rejects dates that PostgreSQL can store but time.Time cannot
|
|
// serialize in API responses. Nil represents an unset schedule or expiry.
|
|
func isJSONTimeInRange(value *time.Time) bool {
|
|
return value == nil || (value.Year() >= 0 && value.Year() <= 9999)
|
|
}
|