]> git.ktnx.net Git - mobile-ledger.git/commitdiff
add SimpleDate.toString()
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Jan 2021 21:06:29 +0000 (21:06 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Jan 2021 21:06:29 +0000 (21:06 +0000)
app/src/main/java/net/ktnx/mobileledger/utils/SimpleDate.java

index 51cf2532d185ce6b1bc03bcf7a5ffe2c56e41500..52db9bdddb3d47675d989c219f8ecd321ef01778 100644 (file)
@@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
 
 import java.util.Calendar;
 import java.util.Date;
+import java.util.Locale;
 
 public class SimpleDate implements Comparable<SimpleDate> {
     public final int year;
@@ -96,4 +97,7 @@ public class SimpleDate implements Comparable<SimpleDate> {
         calendar.set(year, month, day);
         return calendar;
     }
+    public String toString() {
+        return String.format(Locale.US, "%d-%02d-%02d", year, month, day);
+    }
 }