Truncate precise timestamp to seconds.
This commit is contained in:
committed by
Jannis Mattheis
parent
1fb40f2f39
commit
df71fc1820
@@ -25,6 +25,7 @@ import io.noties.markwon.image.picasso.PicassoImagesPlugin;
|
|||||||
import io.noties.markwon.movement.MovementMethodPlugin;
|
import io.noties.markwon.movement.MovementMethodPlugin;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.threeten.bp.OffsetDateTime;
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import org.threeten.bp.temporal.ChronoUnit;
|
||||||
|
|
||||||
public class ListMessageAdapter extends RecyclerView.Adapter<ListMessageAdapter.ViewHolder> {
|
public class ListMessageAdapter extends RecyclerView.Adapter<ListMessageAdapter.ViewHolder> {
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ public class ListMessageAdapter extends RecyclerView.Adapter<ListMessageAdapter.
|
|||||||
String text = "?";
|
String text = "?";
|
||||||
if (dateTime != null) {
|
if (dateTime != null) {
|
||||||
if (preciseDate) {
|
if (preciseDate) {
|
||||||
text = dateTime.toString();
|
text = dateTime.truncatedTo(ChronoUnit.SECONDS).toString();
|
||||||
} else {
|
} else {
|
||||||
text = Utils.dateToRelative(dateTime);
|
text = Utils.dateToRelative(dateTime);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user