mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-29 21:37:56 +01:00 
			
		
		
		
	Fix MAL search results not showing start dates (#1098)
The previous approach would always throw an Exception because `SimpleDateFormat.format()` expects the input to be of type `Date` or `Number`, not `String`.
This commit is contained in:
		| @@ -129,12 +129,7 @@ class MyAnimeListApi( | ||||
|                                 obj["status"]!!.jsonPrimitive.content.replace("_", " ") | ||||
|                             publishing_type = | ||||
|                                 obj["media_type"]!!.jsonPrimitive.content.replace("_", " ") | ||||
|                             start_date = try { | ||||
|                                 val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US) | ||||
|                                 outputDf.format(obj["start_date"]!!) | ||||
|                             } catch (e: Exception) { | ||||
|                                 "" | ||||
|                             } | ||||
|                             start_date = obj["start_date"]?.jsonPrimitive?.content ?: "" | ||||
|                         } | ||||
|                     } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user