Fix ATSB date handling
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Lucidiot 2022-05-10 10:16:39 +02:00
parent 21e668e21d
commit b42245747a
Signed by: lucidiot
GPG Key ID: 3358C1CA6906FB8D
1 changed files with 7 additions and 4 deletions

View File

@ -21,10 +21,13 @@ 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
| strptime("%d %b %Y")
| mktime
| strftime("%a, %d %b %Y %T %z")
if .children[4].text == "N/A" then [.children[2].text] else [.children[4].text] end
| strings
| map(
strptime("%d %b %Y")
| mktime
| strftime("%a, %d %b %Y %T %z")
)
)
}]
}