Skip to content
Snippets Groups Projects
Commit 2c6a63b1 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#598 - fixed handling of dates

parent 0cc151f3
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ public class RepeatingEndOptionConverter_v5 implements Converter<RepeatingEnd, B
break;
case DATE:
DateTime endDate = DateTime.parse(backupItem.getEndDate(), DateTimeFormat.forPattern("yyyy-MM-dd"));
endDate = endDate.withHourOfDay(12).withMinuteOfHour(0).withSecondOfMinute(0);
endOption = new RepeatingEndDate(endDate);
break;
}
......
......@@ -17,7 +17,11 @@ public class RepeatingOptionConverter_v5 implements Converter<RepeatingOption, B
}
final RepeatingOption repeatingOption = new RepeatingOption();
repeatingOption.setStartDate(DateTime.parse(backupItem.getStartDate(), DateTimeFormat.forPattern("yyyy-MM-dd")));
DateTime startDate = DateTime.parse(backupItem.getStartDate(), DateTimeFormat.forPattern("yyyy-MM-dd"));
startDate = startDate.withHourOfDay(12).withMinuteOfHour(0).withSecondOfMinute(0);
repeatingOption.setStartDate(startDate);
repeatingOption.setModifier(new RepeatingModifierConverter_v5().convertToInternalForm(backupItem.getModifier()));
repeatingOption.setEndOption(new RepeatingEndOptionConverter_v5().convertToInternalForm(backupItem.getEndOption()));
return repeatingOption;
......
......@@ -23,7 +23,11 @@ public class TransactionConverter_v5 implements Converter<Transaction, BackupTra
transaction.setIsExpenditure(backupTransaction.getExpenditure());
transaction.setAccount(new AccountConverter_v5().convertToInternalForm(backupTransaction.getAccount()));
transaction.setTransferAccount(new AccountConverter_v5().convertToInternalForm(backupTransaction.getTransferAccount()));
transaction.setDate(DateTime.parse(backupTransaction.getDate(), DateTimeFormat.forPattern("yyyy-MM-dd")));
DateTime date = DateTime.parse(backupTransaction.getDate(), DateTimeFormat.forPattern("yyyy-MM-dd"));
date = date.withHourOfDay(12).withMinuteOfHour(0).withSecondOfMinute(0);
transaction.setDate(date);
transaction.setTags(backupTransaction.getTags());
transaction.setRepeatingOption(new RepeatingOptionConverter_v5().convertToInternalForm(backupTransaction.getRepeatingOption()));
return transaction;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment