Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-10-29 12:56:14 +0300
committerStefan Niedermann <info@niedermann.it>2020-10-29 12:56:14 +0300
commitc985bfef6160929ebb829433ceccd7f2809fb977 (patch)
tree294a3d2be95a56eab924c61ee9aea28b9a0f3232 /app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments
parenta0693708b224ce4fe9cf11150edbd487d4df549b (diff)
#715 Use java.time.*
Fix formatting in comments Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/ItemCommentViewHolder.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/ItemCommentViewHolder.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/ItemCommentViewHolder.java
index 710242d20..3e540c95e 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/ItemCommentViewHolder.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/ItemCommentViewHolder.java
@@ -11,7 +11,9 @@ import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
-import java.text.DateFormat;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.time.format.FormatStyle;
import it.niedermann.android.util.ClipboardUtil;
import it.niedermann.android.util.DimensionUtil;
@@ -26,7 +28,8 @@ import it.niedermann.nextcloud.deck.util.ViewUtil;
import static it.niedermann.nextcloud.deck.util.ViewUtil.setupMentions;
public class ItemCommentViewHolder extends RecyclerView.ViewHolder {
- private ItemCommentBinding binding;
+ private final ItemCommentBinding binding;
+ private final DateTimeFormatter dateFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM);
@SuppressWarnings("WeakerAccess")
public ItemCommentViewHolder(ItemCommentBinding binding) {
@@ -72,7 +75,7 @@ public class ItemCommentViewHolder extends RecyclerView.ViewHolder {
DrawableCompat.setTint(binding.notSyncedYet.getDrawable(), mainColor);
binding.notSyncedYet.setVisibility(DBStatus.LOCAL_EDITED.equals(comment.getStatusEnum()) ? View.VISIBLE : View.GONE);
- TooltipCompat.setTooltipText(binding.creationDateTime, DateFormat.getDateTimeInstance().format(comment.getComment().getCreationDateTime()));
+ TooltipCompat.setTooltipText(binding.creationDateTime, comment.getComment().getCreationDateTime().atZone(ZoneId.systemDefault()).format(dateFormatter));
setupMentions(account, comment.getComment().getMentions(), binding.message);
if (comment.getParent() == null) {