]> git.ktnx.net Git - mobile-ledger.git/commitdiff
new transction/submit: when no date is entered, use today
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 12:58:54 +0000 (12:58 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 9 Dec 2018 12:58:54 +0000 (12:58 +0000)
app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java
app/src/main/res/values-bg/strings.xml
app/src/main/res/values/strings.xml

index 7b893876dd40788ab133ca059ad7b55a315dac02..1f259fba008d217d8a80c1f852952fad25903130 100644 (file)
@@ -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++ ) {
index 8ee99e5f49c9261e37eeb76db510684097faa513..1f2b82951658eefe2cd7c818ba4f9e53a6dcdc4f 100644 (file)
@@ -15,7 +15,7 @@
     <string name="pref_title_backend_auth_password">Парола</string>
     <string name="title_activity_new_transaction">Нова трансакция</string>
     <string name="new_transaction_account_hint">Сметка</string>
-    <string name="new_transaction_date_hint">даÑ\82а</string>
+    <string name="new_transaction_date_hint">днеÑ\81</string>
     <string name="menu_add_account">Добавяне на сметка</string>
     <string name="msg_at_least_two_accounts_are_required">Задължително е използването на поне две сметки</string>
     <string name="err_net_io_error">Мрежова грешка</string>
index dc2be3618d03ea29e51f3b0fd39bdfe029b389ff..87be7f67259a4322c0e93d8a6ef0a38b7767dd1e 100644 (file)
@@ -56,7 +56,7 @@
     <string name="pref_title_backend_auth_password">Password</string>
     <string name="title_activity_new_transaction">New Transaction</string>
     <string name="new_transaction_account_hint">Account</string>
-    <string name="new_transaction_date_hint">date</string>
+    <string name="new_transaction_date_hint">today</string>
     <string name="new_transaction_amount_hint" translatable="false">0.00</string>
     <string name="menu_add_account">Add another acount</string>
     <string name="msg_at_least_two_accounts_are_required">At least two accounts are required</string>