opened
agilgur5
username_0
Apparently some providers say "2 hours ago" or "1 day ago" etc. instead of giving a date when the chapter is recent, so just calling `new Date()` on that text makes it result in `Invalid Date` and also makes it unable to determine that the chapter is new. Related to #7 and #15, that it appears in, and #18 needs this to be fixed.

The simple fix would be just to detect if there's an "ago" in the text and just make the Date equivalent to now instead. A more complex fix would be to actually parse out the number of days or hours and subtract them from the current datetime. Probably gonna go with simpler fix for now; shouldn't be a huge deal, though people who know their release dates might be a bit confused by it, so not ideal.

Also noting that this is actually handled in the scraper code right now, so it's not in the repo. After #6 is completed, we can then think of moving some common transforms into the API code, but right now it's unclear how much will be similar or re-used between them.
"hours ago" / "days ago" results in `Invalid Date`
issue
created
agilgur5
username_0
Ok, fixed this and planning to release either in v0.2.0 or v0.2.1 with other bug fixes (found #21 in the process of fixing this). Expo allows re-publishing the same version, so shouldn't be an issue for v0.2.0. v0.2.1 would have to be with other bugs as the code for this fix is in gitignore'd scraper code.

Also noting that there are options other than "hours ago" it could be, like "Today" or "Yesterday", at least in this provider, so I added logic to handle all those variants.
comment
closed
agilgur5
username_0
issue
created
agilgur5
username_0
Wanted to commit the fix for this and otherwise version control the scraper code, so I've decided to expose some of it and add the commit that fixes this in #22
comment