While we're on this subject... Tapestry's built-in DateTranslator uses
a lenient DateFormat, one of my pet peeves. When a user enters a date
like 03/44/2005 it's probably an error... I don't want it silently
converted to 04/13/2005.
I could override the DateTranslator's behavior in code, add a
f
Thanks guys. Now I can get rid of my custom MaxDate validator class!
Martin Carel wrote:
> Hi Kirby,
>
> >
>
> I just want to mention that I needed to add 'literal' in order for
> this to work (otherwise I have a parsing exception as 'ognl' is the
> default prefix for page spec):
>
>
>
> Than
Hi Kirby,
>
I just want to mention that I needed to add 'literal' in order for this
to work (otherwise I have a parsing exception as 'ognl' is the default
prefix for page spec):
Thanks for this, I can now get rid of my custom MinDate validator class!
> To answer your localisation ques
Hi!
Here is how I solved my tweak #1 (specifying a date (at the beginning of
the day) as a default value).
I implemented my own TypeConverter:
public class IntToDateConverter implements TypeConverter {
static private Calendar getTodaysDate(){
Calendar now = Calen
Hi Martin,
Sorry, looks like I wasn't looking closely enough at what you wanted to do.
I believe your problem is this:
class="org.apache.tapestry.form.validator.MinDate,message={0} must be on
or before {1,minDate,MMM/dd/}">
Try instead:
Note that the 1,date,MM/dd/
Hi!
Thanks both for your feedback. I successfully solved my tweak 1 (will
post another message for explaining how today).
> You should also be able to specify a custom format:
> {0} must be on or before {1,date,MM/dd/}
That'd be nice if I could do that. I used:
class="org.apache.tapestr
Hi Bryan,
Try
Assuming the message conforms to the standard java.text.MessageFormat
class, then it should display the date in the standard short format.
You should also be able to specify a custom format:
{0} must be on or before {1,date,MM/dd/}
Cheers
Richard
Bryan Le
It's certainly possible to do those things with code, although that
approach seems to be falling out of fashion these days. :-)
#1. Write a utility method to call instead of java.util.Date(). What I
use:
public static Date today() {
return org.apache.commons.lang.time.DateUtils.trun