Fix date handling on ATSB feed

This commit is contained in:
~lucidiot 2022-07-04 12:06:32 +02:00
parent 9cc0c75714
commit e364a94a8b
Signed by: lucidiot
GPG Key ID: 3358C1CA6906FB8D
1 changed files with 5 additions and 2 deletions

View File

@ -21,8 +21,11 @@ import "./helpers" as helpers;
"link": (.children[0].children[0].href|helpers::urlresolve("https://www.atsb.gov.au")),
"guid": (.children[0].children[0].href|helpers::urlresolve("https://www.atsb.gov.au")),
"pubDate": (
if .children[4].text == "N/A" then [.children[2].text] else [.children[4].text] end
| strings
[
[.children[2].text, .children[4].text]
| strings
| select(. != "N/A")
][:1]
| map(
strptime("%d %b %Y")
| mktime