Fix Rawkuma date parsing (#2064)

Fix Rawkuma date parsing
This commit is contained in:
happywillow0 2020-01-15 07:33:08 -05:00 committed by arkon
parent 739a1c04b4
commit d100bdca51
2 changed files with 12 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Rawkuma'
pkgNameSuffix = 'ja.rawkuma'
extClass = '.Rawkuma'
extVersionCode = 1
extVersionCode = 2
libVersion = '1.2'
}

View File

@ -10,7 +10,9 @@ import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
class Rawkuma: ParsedHttpSource() {
@ -160,7 +162,15 @@ class Rawkuma: ParsedHttpSource() {
}
private fun parseDate(date: String): Long {
return SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").parse(date).time
return try {
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US).parse(date).time
} catch (e: ParseException) {
try {
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US).parse(date.substringBefore("+")).time
} catch (e: ParseException) {
0L
}
}
}
override fun chapterListSelector() = ".lchx"