From c6487255fb76ba80d88a4f0201a8246f6d050d5b Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:22:17 +0500 Subject: [PATCH] comick: fix date (#16628) --- src/all/comickfun/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt | 5 ++++- .../kanade/tachiyomi/extension/all/comickfun/ComickFunDto.kt | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/all/comickfun/build.gradle b/src/all/comickfun/build.gradle index cd9212ca3..ff8011a67 100644 --- a/src/all/comickfun/build.gradle +++ b/src/all/comickfun/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Comick' pkgNameSuffix = 'all.comickfun' extClass = '.ComickFunFactory' - extVersionCode = 26 + extVersionCode = 27 isNsfw = true } diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt index 576cf2d16..4ec7a6ea2 100644 --- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt +++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt @@ -25,6 +25,7 @@ import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.text.SimpleDateFormat import java.util.Locale +import java.util.TimeZone abstract class ComickFun( override val lang: String, @@ -314,7 +315,9 @@ abstract class ComickFun( companion object { const val SLUG_SEARCH_PREFIX = "id:" val dateFormat by lazy { - SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH) + SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH).apply { + timeZone = TimeZone.getTimeZone("UTC") + } } val markdownLinksRegex = "\\[([^]]+)\\]\\(([^)]+)\\)".toRegex() val markdownItalicBoldRegex = "\\*+\\s*([^\\*]*)\\s*\\*+".toRegex() diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunDto.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunDto.kt index fbd45d0cf..aa1cc9e34 100644 --- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunDto.kt +++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunDto.kt @@ -100,7 +100,7 @@ data class Chapter( val hid: String, val lang: String, val title: String = "", - val updated_at: String = "", + val created_at: String = "", val chap: String = "", val vol: String = "", val group_name: List = emptyList(), @@ -108,7 +108,7 @@ data class Chapter( fun toSChapter(mangaUrl: String) = SChapter.create().apply { url = "$mangaUrl/$hid-chapter-$chap-$lang" name = beautifyChapterName(vol, chap, title) - date_upload = updated_at.parseDate() + date_upload = created_at.parseDate() scanlator = group_name.joinToString().takeUnless { it.isBlank() } ?: "Unknown" } }