mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2165 - Joda LocalDate West of UTC converts incorrectly (Fix: change from epoc millis conversion to y/m/d conversion)
This commit is contained in:
1 parent
d567872813
commit
9e3d6c6a08
2 files changed
+21
-2
No files matched your search
@@ -37,9 +37,10 @@ public class ScalarTypeJodaLocalDate extends ScalarTypeBaseDate<LocalDate> {
|
||||
return LocalDate.fromDateFields(date);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Date convertToDate(LocalDate value) {
|
||||
return new java.sql.Date(convertToMillis(value));
|
||||
return new Date(value .getYear() - 1900, value .getMonthOfYear() - 1, value .getDayOfMonth());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,7 +54,7 @@ public class ScalarTypeJodaLocalDate extends ScalarTypeBaseDate<LocalDate> {
|
||||
@Override
|
||||
public LocalDate toBeanType(Object value) {
|
||||
if (value instanceof java.util.Date) {
|
||||
return convertFromMillis(((java.util.Date) value).getTime());
|
||||
return LocalDate.fromDateFields((java.util.Date)value);
|
||||
}
|
||||
return (LocalDate) value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user