Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added animeAiredString property to Anime model #489

Closed

Conversation

ToshY
Copy link
Contributor

@ToshY ToshY commented Oct 24, 2022

Related to #486, following comment.

@irfan-dahir Related to this issue, there currently is no property in the Anime model which allows to get the raw airdate string. So I would suggest adding a property there, which can use the the getAnimeAiredString from the AnimeParser. If you're okay with that, I can make the PR.

@irfan-dahir
Copy link
Collaborator

irfan-dahir commented Oct 25, 2022

Hi, you can get raw airdate by typecasting string to the DateRange object

It's returned like that in the RESTAPI as well:
https://github.com/jikan-me/jikan-rest/blob/16560d3634c6a9116ad7234985aa4e84a11bd683/app/Providers/SerializerFactory.php#L69

'string' => (string)$obj,

In this case you'd have to typecast the following property when getting it:

private DateRange $aired;

(string) $anime->getAired()

@ToshY
Copy link
Contributor Author

ToshY commented Oct 25, 2022

Totally missed that. Thanks @irfan-dahir !

@ToshY ToshY closed this Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants