开发者

how to validate a date [closed]

开发者 https://www.devze.com 2023-01-08 17:39 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot b开发者_开发问答e reasonably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot b开发者_开发问答e reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

how to validate a given date


Prepare a time object from params and simply check it from Time.now

t1 = Time.new(params[:date])

if t1 > Time.now
       # your code 
end
0

精彩评论

暂无评论...
验证码 换一张
取 消