fix parseChapterDate (#1096)
* fix parseChapterDate * Update build.gradle * Update Mangahere.kt Ah sorry my bad
This commit is contained in:
parent
2b3d92981a
commit
c0d9d393bf
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: Mangahere'
|
||||
pkgNameSuffix = 'en.mangahere'
|
||||
extClass = '.Mangahere'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -161,12 +161,29 @@ class Mangahere : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
private fun parseChapterDate(date: String): Long {
|
||||
return try {
|
||||
return if ("Today" in date || " ago" in date){
|
||||
Calendar.getInstance().apply {
|
||||
set(Calendar.HOUR_OF_DAY, 0)
|
||||
set(Calendar.MINUTE, 0)
|
||||
set(Calendar.SECOND, 0)
|
||||
set(Calendar.MILLISECOND, 0)
|
||||
}.timeInMillis
|
||||
} else if ("Yesterday" in date) {
|
||||
Calendar.getInstance().apply {
|
||||
add(Calendar.DATE, -1)
|
||||
set(Calendar.HOUR_OF_DAY, 0)
|
||||
set(Calendar.MINUTE, 0)
|
||||
set(Calendar.SECOND, 0)
|
||||
set(Calendar.MILLISECOND, 0)
|
||||
}.timeInMillis
|
||||
} else {
|
||||
try {
|
||||
SimpleDateFormat("MMM dd,yyyy", Locale.ENGLISH).parse(date).time
|
||||
} catch (e: ParseException) {
|
||||
0L
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
|
||||
|
|
Loading…
Reference in New Issue