From: Damyan Ivanov Date: Tue, 27 Apr 2021 19:18:19 +0000 (+0300) Subject: stop resetting the date when an old transaction is loaded into the form X-Git-Tag: v0.18.0~8 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ee517e303eef7ec2ba6ca39dc73252b539bce0da;p=mobile-ledger.git stop resetting the date when an old transaction is loaded into the form --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index 95444ac6..311226da 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -469,8 +469,12 @@ public class NewTransactionModel extends ViewModel { List 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);