]> git.ktnx.net Git - mobile-ledger.git/commitdiff
stop resetting the date when an old transaction is loaded into the form
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 27 Apr 2021 19:18:19 +0000 (22:18 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 30 Apr 2021 19:20:20 +0000 (19:20 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java

index 95444ac6c33c8145f134c846056dfdca94396186..311226dacd6ec85504e562bc30bab73bf1697e63 100644 (file)
@@ -469,8 +469,12 @@ public class NewTransactionModel extends ViewModel {
         List<Item> newList = new ArrayList<>();
         Item.resetIdDispenser();
 
+        Item currentHead = items.getValue()
+                                .get(0);
         TransactionHead head = new TransactionHead(tr.transaction.getDescription());
         head.setComment(tr.transaction.getComment());
+        if (currentHead instanceof TransactionHead)
+            head.setDate(((TransactionHead) currentHead).date);
 
         newList.add(head);