Skip to content
Snippets Groups Projects
Commit b25f660b authored by srosse's avatar srosse
Browse files

OO-1605: overwrite the pattern for our date+time formatter to display year with 4 digits

parent d46fd0bc
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,11 @@ public class Formatter { ...@@ -77,6 +77,11 @@ public class Formatter {
mediumTimeFormat.setLenient(false); mediumTimeFormat.setLenient(false);
shortDateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale); shortDateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
shortDateTimeFormat.setLenient(false); shortDateTimeFormat.setLenient(false);
if (shortDateTimeFormat instanceof SimpleDateFormat) {
SimpleDateFormat sdf = (SimpleDateFormat) shortDateTimeFormat;
String pattern = sdf.toPattern().replaceAll("y+","yyyy");
sdf.applyPattern(pattern);
}
shortTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, locale); shortTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
shortTimeFormat.setLenient(false); shortTimeFormat.setLenient(false);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment