diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-29 10:49:22 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-29 10:49:22 +0300 |
commit | 97049560a1e8d03fddadf9d825be69f88ab096af (patch) | |
tree | a779775943b177995cd471853cac291ba5ac1729 /app/src/main/java/it/niedermann/nextcloud/deck/model | |
parent | 090229aa9e411114c9f235e622f042b7aae3f664 (diff) |
#715 Use java.time.*
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/model')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java index 8db7f7cf1..40b6d6719 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java @@ -8,8 +8,7 @@ import androidx.room.Index; import com.google.gson.annotations.SerializedName; -import java.time.LocalDateTime; -import java.time.ZoneId; +import java.time.Instant; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -207,8 +206,8 @@ public class Card extends AbstractRemoteEntity { } @Ignore - public LocalDateTime getDueDateLocalDateTime() { - return LocalDateTime.ofInstant(getDueDate().toInstant(), ZoneId.systemDefault()); + public Instant getDueDateInstant() { + return dueDate == null ? null : dueDate.toInstant(); } public void setDueDate(Date dueDate) { @@ -216,8 +215,8 @@ public class Card extends AbstractRemoteEntity { } @Ignore - public void setDueDateLocalDateTime(@NonNull LocalDateTime dateTime) { - this.dueDate = Date.from(dateTime.atZone(ZoneId.systemDefault()).toInstant()); + public void setDueDateInstant(@NonNull Instant dateTime) { + this.dueDate = Date.from(dateTime); } public int getOverdue() { |