Michiel Meeuwissen <[EMAIL PROTECTED]> wrote:

> How about locales and timezones? I call my editwizard with 'language=nl'
and
> everything appears in dutch, except for dates in lists:
>
> # Titel Online op Object Eigenaar
> 1 Vergeet geen titel te bedenken! 02 June 2004 11:47 409 admin
>
>
> That is a bug? Should the Locale or Language not be passed into the
> DateFormat methods?
>

Timezones do work now in the editwizard, but the locale was not included.
The language problem can be fixed by changing in
applications\editwizard\templates\data\baselist.xsl and wizard.xsl

date:formatTimeZone(string($val), $date-pattern, $timezone)

to

date:formatTimeZone(string($val), $date-pattern, $timezone, $language)

and change in src\org\mmbase\bridge\util\xml\DataFormat.java

   public static String formatTimeZone(String fieldValue, String pattern,
int factor, String timeZone) {
        if (fieldValue == null || "".equals(fieldValue)) {
           return "";
        }
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);

to

   public static String formatTimeZone(String fieldValue, String pattern,
int factor, String timeZone, String language) {
        if (fieldValue == null || "".equals(fieldValue)) {
           return "";
        }
        Locale locale = new Locale(language);
        SimpleDateFormat sdf = new SimpleDateFormat(pattern, locale);

Also other functions in DateFormat need to include the language and probably
I have made an error, because I did not test the code.

Martijn Houtman


Martijn Houtman





Reply via email to