Include a fast path to invalidate YearMonth
This commit is contained in:
parent
0aa0a5ad4f
commit
f1adae4337
@ -60,7 +60,7 @@ func Date(date string) bool {
|
|||||||
|
|
||||||
// YearMonth tells you whether the date contain only the year and the month.
|
// YearMonth tells you whether the date contain only the year and the month.
|
||||||
func YearMonth(date string) bool {
|
func YearMonth(date string) bool {
|
||||||
if date == "" || strings.HasPrefix(date, "0001") {
|
if len(date) != len(YearMonthFormat) || strings.HasPrefix(date, "0001") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user