From: Damyan Ivanov Date: Sun, 24 Nov 2019 11:13:11 +0000 (+0200) Subject: NT: fix month interpretation when formatting calendar date X-Git-Tag: v0.11.0~45 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ba6513e75e8cfc577f333fb38c0e6c597f9c8875;p=mobile-ledger.git NT: fix month interpretation when formatting calendar date --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java index e1166b2e..4c200fc5 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java @@ -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);