Add time_str to starrail rogue locust record

This commit is contained in:
xtaodada 2023-09-06 21:38:45 +08:00
parent 4f9e7e7db1
commit 95a31370d9
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -149,6 +149,14 @@ class RogueLocustRecordDetail(APIModel):
worm_weak: List[str]
fury: RogueLocustRecordDetailFury
@property
def time_str(self) -> str:
"""Get the time as a string."""
if self.finish_time is None:
return "N/A"
return self.finish_time.datetime.strftime("%Y.%m.%d %H:%M")
class RogueLocustRecords(APIModel):
"""Rogue Locust records"""