Open dsl101 opened 8 years ago
I think an option to parse date fields as strings instead of dates is a useful enhancement. PR welcome!
I would prefer the name parseDate
for the option (and it should default to true
).
I would prefer the name parseDate for the option (and it should default to true).
Both of these opinions of mine are terrible. Sorry, @dsl101.
I'm using firebase as a backend for storage, and it has the interesting feature that it can't store javascript Date objects. Whilst I'm in the process of discussing this with firebase (I think it probably should, but who knows what they'll decide), I made the following local changes to feedparser to provide an option to return any dates in the item and metadata as strings. Sorry I didn't make a branch, so can't do this as a pull request, but in case it helps anyone else.
New option:
dateAsString
: Defaults tofalse
. Returns dates as strings rather than Date() objectsmain.js Diff: