Skip to content

Commit cd60aea

Browse files
BeanTableDataSource allows for the creation of Tables on Collection of Java Beans.
1 parent f985e6c commit cd60aea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/io/frictionlessdata/tableschema/field/DatetimeField.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import java.util.regex.Pattern;
1414

1515
public class DatetimeField extends Field<ZonedDateTime> {
16-
private static final DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE_TIME;
16+
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ISO_DATE_TIME;
1717
// ISO 8601 format of yyyy-MM-dd'T'HH:mm:ss.SSSZ in UTC time
1818
private static final String REGEX_DATETIME
1919
= "(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?";
@@ -39,7 +39,7 @@ public ZonedDateTime parseValue(String value, String format, Map<String, Object>
3939
Matcher matcher = pattern.matcher(value);
4040

4141
if(matcher.matches()){
42-
TemporalAccessor dt = formatter.parse(value);
42+
TemporalAccessor dt = FORMATTER.parse(value);
4343

4444
return ZonedDateTime.from(dt);
4545
}else{
@@ -51,7 +51,7 @@ public ZonedDateTime parseValue(String value, String format, Map<String, Object>
5151
public String formatValueAsString(ZonedDateTime value, String format, Map<String, Object> options) throws InvalidCastException, ConstraintsException {
5252
if (null == value)
5353
return null;
54-
return value.format(formatter);
54+
return value.format(FORMATTER);
5555
}
5656

5757
@Override

0 commit comments

Comments
 (0)