From: Damyan Ivanov Date: Sun, 9 Dec 2018 12:58:54 +0000 (+0000) Subject: new transction/submit: when no date is entered, use today X-Git-Tag: v0.3~270 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ffd3fc6e70872c8fcbf41a39ba6641bfbc45a37e;p=mobile-ledger.git new transction/submit: when no date is entered, use today --- diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index 7b893876..1f259fba 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -33,6 +33,7 @@ import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; +import java.util.Date; import java.util.Objects; /* @@ -109,7 +110,9 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal saver = new SaveTransactionTask(this); saver.setPref(PreferenceManager.getDefaultSharedPreferences(this)); - LedgerTransaction tr = new LedgerTransaction(text_date.getText().toString(), text_descr.getText().toString()); + String date = text_date.getText().toString(); + if (date.isEmpty()) date = String.valueOf(new Date().getDate()); + LedgerTransaction tr = new LedgerTransaction(date, text_descr.getText().toString()); TableLayout table = findViewById(R.id.new_transaction_accounts_table); for ( int i = 0; i < table.getChildCount(); i++ ) { diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 8ee99e5f..1f2b8295 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -15,7 +15,7 @@ Парола Нова трансакция Сметка - дата + днес Добавяне на сметка Задължително е използването на поне две сметки Мрежова грешка diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dc2be361..87be7f67 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -56,7 +56,7 @@ Password New Transaction Account - date + today 0.00 Add another acount At least two accounts are required