import net.ktnx.mobileledger.model.LedgerTransaction;
import net.ktnx.mobileledger.model.LedgerTransactionAccount;
import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.Misc;
import java.text.ParseException;
import java.util.ArrayList;
public LedgerTransaction asLedgerTransaction() throws ParseException {
Date date = Globals.parseIsoDate(tdate);
LedgerTransaction tr = new LedgerTransaction(tindex, date, tdescription);
+ tr.setComment(Misc.trim(Misc.emptyIsNull(tcomment)));
List<ParsedPosting> postings = tpostings;
import net.ktnx.mobileledger.model.LedgerTransaction;
import net.ktnx.mobileledger.model.LedgerTransactionAccount;
import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.Misc;
import java.text.ParseException;
import java.util.ArrayList;
public LedgerTransaction asLedgerTransaction() throws ParseException {
Date date = Globals.parseIsoDate(tdate);
LedgerTransaction tr = new LedgerTransaction(tindex, date, tdescription);
+ tr.setComment(Misc.trim(Misc.emptyIsNull(tcomment)));
List<ParsedPosting> postings = tpostings;
import android.content.res.Configuration;
import android.view.WindowManager;
+import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
return true;
return text.length() == 0;
}
+ public static String trim(@Nullable String string) {
+ if (string == null)
+ return null;
+
+ return string.trim();
+ }
}