#24 Dates are showed in English format

closed
Dates (1)
8
2014-07-12
2014-04-09
Carlos SS
No

Hi Santiago!
Dates are showed in English format because they are defined as is in "FormatSingleton.java".

I've made a patch to use "Locale" rather than an specified format mask.

Ciao!

1 Attachments

Discussion

  • Carlos SS
    Carlos SS
    2014-04-10

    P.D.: There is a mistake and must be resolved in a similar way than "BeoBatcher", changing from:
    dateFormat = new SimpleDateFormat();
    to:
    dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, getLocale());

    But problem is:
    How we can get locale in this class "FormatSingleton"? Seems to be an static and "strange" class and I don't want touch it in a wrong way.

     
    Last edit: Carlos SS 2014-04-10
  • Carlos SS
    Carlos SS
    2014-04-11

    P.D.: An "medium" stable solution can be provided in this last patch. Works well for many languages but for Spanish isn't showing leading zeroes neither dates nor times.

    But I think a more reliable solution can be move contents of "FormatSingleton" class to constants initialized when program starts.

     
    Last edit: Carlos SS 2014-04-11

  • Anonymous
    2014-04-14

    Hello Santiago!
    Finally I think we need in this case "constants": it's the only way to get only once format loaded and used many times. Please, study this patch.

     
  • Carlos SS
    Carlos SS
    2014-04-14

    Sorry, I'm owner of last post: I wasn't logged.

    Hello Santiago!
    Finally I think we need in this case "constants": it's the only way to get only once format loaded and used many times. Also for "DecimalFormat" I think we don't need an special mask (default mask runs well). Please, study this patch.

     
    Last edit: Carlos SS 2014-04-14


Anonymous


Cancel   Add attachments