8000 gteField 校验bug · Issue #159 · gookit/validate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gteField 校验bug #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ccxdd opened this issue Aug 20, 2022 · 3 comments
Closed

gteField 校验bug #159

ccxdd opened this issue Aug 20, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request resolved

Comments

@ccxdd
Copy link
ccxdd commented Aug 20, 2022
type TestStruct struct {
	Start string `json:"start" validate:"date|minLen:10"`
	End   string `json:"end" validate:"date|minLen:10|gteField:start"`
}

start = "2021-12-17"
end = "2020-12-16"

验证通过

@inhere
Copy link
Member
inhere commented Aug 21, 2022

这是比较大小的呀。 比较 字符串 这个我没试过

@inhere inhere added question Further information is requested enhancement New feature or request and removed question Further information is requested labels Aug 21, 2022
@inhere inhere closed this as completed in 67c93b3 Aug 24, 2022
@inhere
Copy link
Member
inhere commented Aug 24, 2022

已经调整,支持比较字符串了 https://github.com/gookit/validate/releases/tag/v1.4.3

@ccxdd
Copy link
Author
ccxdd commented Apr 24, 2024
CooperationStart  string `json:"cooperation_start" validate:"date|minLen:10"`                        //开始日期
CooperationEnd    string `json:"cooperation_end" validate:"date|minLen:10|gteField:cooperation_start"` //结束日期

"cooperation_start"名字里带下划线"_"校验就通不过,用驼峰就可以"cooperationStart"

CooperationStart  string `json:"cooperationStart" validate:"date|minLen:10"`                        //开始日期
CooperationEnd    string `json:"cooperation_end" validate:"date|minLen:10|gteField:cooperationStart"` //结束日期

这样就能通过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resolved
Projects
None yet
Development

No branches or pull requests

2 participants
0