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