From 6e1bf2965d094cecb702f5adee3982075651dc3e Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 30 Sep 2011 16:54:01 +0200 Subject: [PATCH] Fixed DateFormatValidator to handle placeholders SHORT and MEDIUM --- src/com/fsck/k9/preferences/GlobalSettings.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/fsck/k9/preferences/GlobalSettings.java b/src/com/fsck/k9/preferences/GlobalSettings.java index 8064c67ef..5c2291b24 100644 --- a/src/com/fsck/k9/preferences/GlobalSettings.java +++ b/src/com/fsck/k9/preferences/GlobalSettings.java @@ -191,6 +191,13 @@ public class GlobalSettings { @Override public boolean isValid(String key, String value, Map validatedSettings) { try { + // The placeholders "SHORT" and "MEDIUM" are fine. + if (DateFormatter.SHORT_FORMAT.equals(value) || + DateFormatter.MEDIUM_FORMAT.equals(value)) { + return true; + } + + // If the SimpleDateFormat constructor doesn't throw an exception, we're good. new SimpleDateFormat(value); return true; } catch (Exception e) {