Skip to content

Commit

Permalink
Call Instant.parse() before DateTimeParser
Browse files Browse the repository at this point in the history
  • Loading branch information
kpartlow committed Feb 12, 2024
1 parent f589fe3 commit fb55240
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
Expand Down Expand Up @@ -80,11 +81,15 @@ static Date toDate(Object from, Converter converter) {
static Calendar toCalendar(Object from, Converter converter) {
return CalendarConversions.create(toLong(from, converter), converter);
}

static BigInteger toBigInteger(Object from, Converter converter) {
return BigInteger.valueOf(toLong(from, converter));
}

static String toString(Object from, Converter converter) {
return DateTimeFormatter.ISO_INSTANT.format((Instant)from);
}

static BigDecimal toBigDecimal(Object from, Converter converter) {
return BigDecimal.valueOf(toLong(from, converter));
}
Expand Down

0 comments on commit fb55240

Please sign in to comment.