Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Greg Lindholm
On Wed, Nov 4, 2009 at 2:54 PM, Siddiq Syed wrote: > > When you have a validation file like actionname-aliase-validation.xml and > you want to carryout date validation in that as other validation , there is > no direct way to do that. > Correct, this is a limitation, there currently is no way t

Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Siddiq Syed
When you have a validation file like actionname-aliase-validation.xml and you want to carryout date validation in that as other validation , there is no direct way to do that. Handling DateFormat.parse() is more java specific way and can be done in any layer of the application. The front-end val

Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Greg Lindholm
Still a bad idea as it allows invalid dates (e.g. Nov. 31) and does nothing for leap years. If you want to know if a date is valid use DateFormat.parse(). On Wed, Nov 4, 2009 at 2:16 PM, Kawczynski, David < david_kawczyn...@merck.com> wrote: > That is unreadable. What about this, it's much eas

RE: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Siddiq Syed
Does it checks for leap year ? (0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d I guess this does not check for leap year, If the user enter the leap year the framework passes the validation successfully. which it should not and give you the error message. Kawczynski, David wrot

RE: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Kawczynski, David
That is unreadable. What about this, it's much easier on the eyes: (0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d From http://www.regular-expressions.info/regexbuddy/datemmdd.html > > Greg Lindholm-2 wrote: > > > > > >> > >> > (((0[13578])|(1[02]))[\/]((0[1-9])|([12

Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Siddiq Syed
But I guess there is no direct validation for a date in struts 2. If you give date validation like mention below 01/01/1990 01/01/2000 Joining date must be supplied between ${min} and ${max} It will check for the range , not the validation , like invalid value and leap

Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Greg Lindholm
> > (((0[13578])|(1[02]))[\/]((0[1-9])|([12]\d)|(3[01])))|(((0[469])|(11))[\/]?((0[1-9])|([12]\d)|(30)))|((0?2)[\/]((0[1-9])|(1\d)|(2[0-8][\/](((19)|([1-9][0-9]))([\d][\d]|((0?2)[\/](29)[\/](((19)|([1-9][0-9]))(([02468][048])|([13579][26])$ > > > > IMHO this is unreadable and unma

Re: s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread Siddiq Syed
As far as date validation are concerned , declare the date variable as string in your view bean, Add regular expression validation in the validation file. (((0[13578])|(1[02]))[\/]((0[1-9])|([12]\d)|(3[01])))|(((0[469])|(11))[\/]?((0[1-9])|([12]\d)|(30)))|((0?2)[\/]((0[1-9])|(1\d)|(2[0-8]))

s:textfield and date format as dd/MM/yyyy

2009-11-04 Thread carl ballantyne
Hi All, I have a Person object with a birthday attribute which is a Date. In the form I have a textfield to enter the value. I want the field to display the date in the format dd/MM/ and the validation to apply using that format. However everything I am trying does not work. I tried p