fix genkan year timestamp (#5638)
timestamp longer than 1 year shows as current year
This commit is contained in:
parent
c1da304544
commit
9e9e3593eb
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Genkan (multiple sources)'
|
||||
pkgNameSuffix = 'all.genkan'
|
||||
extClass = '.GenkanFactory'
|
||||
extVersionCode = 24
|
||||
extVersionCode = 25
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -143,6 +143,7 @@ abstract class Genkan(
|
|||
|
||||
val calendar = Calendar.getInstance()
|
||||
when (trimmedDate[1]) {
|
||||
"year" -> calendar.apply { add(Calendar.YEAR, -trimmedDate[0].toInt()) }
|
||||
"month" -> calendar.apply { add(Calendar.MONTH, -trimmedDate[0].toInt()) }
|
||||
"week" -> calendar.apply { add(Calendar.WEEK_OF_MONTH, -trimmedDate[0].toInt()) }
|
||||
"day" -> calendar.apply { add(Calendar.DAY_OF_MONTH, -trimmedDate[0].toInt()) }
|
||||
|
|
Loading…
Reference in New Issue