diff --git a/app/src/main/java/com/loganfreeman/utahfishing/common/utils/Time.java b/app/src/main/java/com/loganfreeman/utahfishing/common/utils/Time.java index f4c791c..38afe53 100644 --- a/app/src/main/java/com/loganfreeman/utahfishing/common/utils/Time.java +++ b/app/src/main/java/com/loganfreeman/utahfishing/common/utils/Time.java @@ -1,11 +1,16 @@ package com.loganfreeman.utahfishing.common.utils; import android.annotation.SuppressLint; + +import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Time { + public static final DateFormat df = new SimpleDateFormat("mm/dd/yyyy"); + + /** * yyyy-MM-dd HH:mm:ss */ diff --git a/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/domain/StockReport.java b/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/domain/StockReport.java index d2f90bd..396a8af 100644 --- a/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/domain/StockReport.java +++ b/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/domain/StockReport.java @@ -28,7 +28,9 @@ import rx.subjects.AsyncSubject; import static android.R.id.list; +import static android.icu.lang.UCharacter.GraphemeClusterBreak.T; import static java.util.Arrays.stream; +import static com.loganfreeman.utahfishing.common.utils.Time.df; /** * Created by shanhong on 3/21/17. @@ -40,9 +42,6 @@ public class StockReport implements Parcelable { private static final AsyncSubject> mSubject = AsyncSubject.create(); - public static final DateFormat df = new SimpleDateFormat("mm/dd/yyyy"); - - public static final Pattern dayMonYear = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{4})"); public String watername; public String county; diff --git a/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/ui/SimpleAdapter.java b/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/ui/SimpleAdapter.java index 5c93a0a..bda3336 100644 --- a/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/ui/SimpleAdapter.java +++ b/app/src/main/java/com/loganfreeman/utahfishing/modules/fishing/ui/SimpleAdapter.java @@ -17,6 +17,9 @@ import java.util.List; import java.util.stream.Collectors; +import static com.loganfreeman.utahfishing.common.utils.Time.df; + + /** * Created by shanhong on 3/22/17. */ @@ -66,7 +69,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { viewHolder.species.setText(report.species); viewHolder.quantity.setText(String.valueOf(report.quantity)); viewHolder.length.setText(String.valueOf(report.length)); - viewHolder.stockdate.setText(StockReport.df.format(report.stockdate)); + viewHolder.stockdate.setText(df.format(report.stockdate)); } diff --git a/app/src/test/java/com/loganfreeman/utahfishing/ExampleUnitTest.java b/app/src/test/java/com/loganfreeman/utahfishing/ExampleUnitTest.java index b508abe..e7319e9 100644 --- a/app/src/test/java/com/loganfreeman/utahfishing/ExampleUnitTest.java +++ b/app/src/test/java/com/loganfreeman/utahfishing/ExampleUnitTest.java @@ -11,4 +11,10 @@ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } + + + @Test + public void testCalendarDay() { + + } } \ No newline at end of file