On Wed, Dec 1, 2010 at 11:50 AM, HerrB92 <[email protected]> wrote:
> Err, yes ... I don't ever want a 2-digit year, also. > > I have people, that enter "10" and expect to get "2010". Currently, > you will get "0010" (with a "yyyy" pattern). > > But I think, I get the point: If there is textfield and a user enters > 1.1.10 and default date parsing is used (pattern "dd.MM.yyyy"), you > will get a valid date object - 10 years AC. My request would mean, > that if .format() is applied to that date, that the century is > replaced by the guessed century, if the given century equals "00". > My point is that you want to fix that at the point the date is entered, not to just display the date differently, since many other things will depend on the year being correct. Ie, Date d = fixMissingCentury(dtf.parse(dateField)); where fixMissingCentury detects a first-century year and changes it according to your needs. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
