diff options
author | cyBerta <cyberta@riseup.net> | 2020-12-29 00:54:08 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2020-12-29 00:54:08 +0100 |
commit | 6b032b751324a30120cfaabe88940f95171df11f (patch) | |
tree | b6b26b84358726a02e27558562e7e9ea70a7aaa0 /app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java | |
parent | 16da1eeb5180cbb4a0d916785a08ccbcd3c1d74e (diff) |
new year cleanup: restructure messy project
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java b/app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java deleted file mode 100644 index 523c8c4c..00000000 --- a/app/src/main/java/se/leap/bitmaskclient/utils/DateHelper.java +++ /dev/null @@ -1,29 +0,0 @@ -package se.leap.bitmaskclient.utils; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; - -/** - * Contains helper methods related to date manipulation. - * - * @author Janak - */ -public class DateHelper { - private static final String DATE_PATTERN = "dd/MM/yyyy"; - private static final int ONE_DAY = 86400000; //1000*60*60*24 - - public static long getDateDiffToCurrentDateInDays(String startDate) throws ParseException { - SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN, Locale.US); - Date lastDate = sdf.parse(startDate); - Date currentDate = new Date(); - return (currentDate.getTime() - lastDate.getTime()) / ONE_DAY; - } - - public static String getCurrentDateString() { - SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN, Locale.US); - Date lastDate = new Date(); - return sdf.format(lastDate); - } -} |