# Validation on "date"

**URL:** <https://www.ruby-forum.com/t/validation-on-date/134147>\
**Category:** Rails\
**Created:** [April 8, 2008, 10:44am UTC](https://www.ruby-forum.com/t/validation-on-date/134147 "2008-04-08T10:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 8, 2008, 10:44am UTC](https://www.ruby-forum.com/t/validation-on-date/134147/1 "2008-04-08T10:44:45Z")

</div>

hi all,

```
      im having a date part in one of my view page.i used

```

tag for it.i set the format as mm/dd/yyyy.i want to show a  
validation message when user entered the date as 30/02/any year or  
31/02/any year.im waiting for the replies.

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 8, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/validation-on-date/134147/2 "2008-04-08T16:15:03Z")

</div>

Karthikragunath B. wrote:

> hi all,
> 
> ```
> im having a date part in one of my view page.i used
> 
> ```
> 
> [date\_select] tag for it.i set the format as mm/dd/yyyy.i want to show a  
> validation message when user entered the date as 30/02/any year or  
> 31/02/any year.im waiting for the replies.

[http://www.ruby-doc.org/core/](http://www.ruby-doc.org/core/)

Check the Date class… perhaps you want valid\_civil? or  
valid\_commercial? or one of the other variants.
