#344 New pattern in DateTimeCombinedFormatter

v5.0.1
closed
nobody
None
5
2014-07-01
2013-05-23
Granjero Moe
No

When you have a Date field and you write a date using the patter dd/MM/yy it doesn't work well, eg. if you write '23/05/13' openxava converts to '23/05/0013 00:00' instead of '23/05/2013 00:00'.

It's easy to correct it.
You have to add a new line in org.openxava.formatters.DateTimeCombinedFormatter.java:

    private static DateFormat [] spanishDateTimeFormats = {
        spanishDateTimeFormat,
        new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"),
        new SimpleDateFormat("dd/MM/yyyy HH:mm"),
        new SimpleDateFormat("ddMMyyyy HH:mm"),
        new SimpleDateFormat("ddMMyyyy HH:mm:ss"),
        new SimpleDateFormat("dd.MM.yyyy HH:mm"),       
        new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"),
        new SimpleDateFormat("dd/MM/yy"), // NEW LINE
        new SimpleDateFormat("dd/MM/yyyy"),     
        new SimpleDateFormat("ddMMyyyy"),       
        new SimpleDateFormat("dd.MM.yyyy")  };

Discussion

  • Javier Paniza
    Javier Paniza
    2014-07-01

    • status: open --> closed
    • Group: v4.7 --> v5.0.1