fix: day formatting; closes #312 (#313)

This commit is contained in:
Diego Beraldin 2023-12-17 09:55:10 +01:00 committed by GitHub
parent 395968653d
commit 0d0b1f6c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,10 +31,10 @@ actual object DateTime {
val delta = Period.between(date.toLocalDate(), now.toLocalDate())
val years = delta.years
val months = delta.months
val days = delta.days
val nowSeconds = now.toEpochSecond()
val dateSeconds = date.toEpochSecond()
val diffSeconds = (nowSeconds - dateSeconds)
val days = diffSeconds / 86400
val hours = ((diffSeconds % 86400) / 3600) % 24
val minutes = ((diffSeconds % 3600) / 60) % 60
val seconds = diffSeconds % 60