]> git.ktnx.net Git - mobile-ledger.git/commitdiff
NT: fix month interpretation when formatting calendar date
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Nov 2019 11:13:11 +0000 (13:13 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Nov 2019 11:13:11 +0000 (13:13 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java

index e1166b2ee9f3c0e095c509fb6a0e5cad9987c7f3..4c200fc592af0ea2610c890d2f54b53d67d822fd 100644 (file)
@@ -444,11 +444,11 @@ public class NewTransactionModel extends ViewModel {
             final int myDay = c.get(Calendar.DAY_OF_MONTH);
 
             if (today.get(Calendar.YEAR) != myYear) {
-                return String.format(Locale.US, "%d/%02d/%02d", myYear, myMonth, myDay);
+                return String.format(Locale.US, "%d/%02d/%02d", myYear, myMonth + 1, myDay);
             }
 
             if (today.get(Calendar.MONTH) != myMonth) {
-                return String.format(Locale.US, "%d/%02d", myMonth, myDay);
+                return String.format(Locale.US, "%d/%02d", myMonth + 1, myDay);
             }
 
             return String.valueOf(myDay);