Fixed extracting year, month and day

This commit is contained in:
dankito 2020-07-12 12:47:10 +02:00
parent 563efc0ad8
commit ba46c26bf7
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ actual class Date actual constructor(millisSinceEpoch: Long) : java.util.Date(mi
actual fun year(): Int { actual fun year(): Int {
return formatDate(DateFormat.YEAR_FIELD) return super.getYear() + 1900
} }
actual fun month(): Month { actual fun month(): Month {
@ -25,11 +25,11 @@ actual class Date actual constructor(millisSinceEpoch: Long) : java.util.Date(mi
} }
actual fun monthInt(): Int { actual fun monthInt(): Int {
return formatDate(DateFormat.MONTH_FIELD) return super.getMonth() + 1
} }
actual fun day(): Int { actual fun day(): Int {
return formatDate(DateFormat.DAY_OF_YEAR_FIELD) return super.getDate()
} }
private fun formatDate(dateFormatStyle: Int): Int { private fun formatDate(dateFormatStyle: Int): Int {