mirror of
https://github.com/frosch95/SmartCSV.fx.git
synced 2026-04-11 21:48:22 +02:00
fixed broken tests
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package ninja.javafx.smartcsv.validation;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
* @author abi
|
||||
*/
|
||||
@@ -31,6 +33,13 @@ public class ValidationFormatHelper {
|
||||
format = format.replace("%j", "DDD");
|
||||
format = format.replace("%U", "ww");
|
||||
return format;
|
||||
} else {
|
||||
try {
|
||||
new SimpleDateFormat(format);
|
||||
return format;
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultFormat;
|
||||
|
||||
@@ -181,12 +181,12 @@ public class Validator {
|
||||
}
|
||||
|
||||
if (column.getType() == DATE) {
|
||||
String format = dateFormat(column.getFormat(), "YYYY-MM-DD");
|
||||
String format = dateFormat(column.getFormat(), "yyyy-MM-dd");
|
||||
add(column.getName(), new DateValidation(format));
|
||||
}
|
||||
|
||||
if (column.getType() == DATETIME) {
|
||||
String format = dateFormat(column.getFormat(), "YYYY-MM-DDThh:mm:ssZ");
|
||||
String format = dateFormat(column.getFormat(), "yyyy-MM-ddThh:mm:ssZ");
|
||||
add(column.getName(), new DateValidation(format));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user