mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-24 08:38:51 -05:00
Fixed DateFormatValidator to handle placeholders SHORT and MEDIUM
This commit is contained in:
parent
cd72e197ec
commit
6e1bf2965d
@ -191,6 +191,13 @@ public class GlobalSettings {
|
||||
@Override
|
||||
public boolean isValid(String key, String value, Map<String, String> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user