kotatsu-parsers
kotatsu-parsers copied to clipboard
I'd like to simplify the parse of dates in chapters.
Describe your suggested feature
I'd like to simplify the parse of dates in chapters. Currently, if a date is not "classic", e.g. 10 days ago, we have to parse it with the "parseChapterDate" function, which is then copied everywhere. As a result, I think it would be useful to add a global "parseChapterDate" function to the tools, to avoid having to copy the function everywhere. In fact, I was wondering whether we could simply add an option in "dateFormat.tryParse(date)" so that if the function fails to parse the date, it tries to do so via "parseChapterDate", so we wouldn't have to wonder whether the date is classic or written as in the example above. The only unknown is that I don't know if this would slow down the app.
Other details
No response
Acknowledgements
- [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.