Make rss generation cross-platform

This commit is contained in:
Konstantin Nazarov 2021-09-25 16:58:42 +01:00
parent db83ea9a70
commit 78dcfd44aa
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22

View file

@ -5,11 +5,19 @@ remove_nbsp() {
} }
date_rfc_822() { date_rfc_822() {
if [[ "$OSTYPE" == "darwin"* ]]; then
date -j '+%a, %d %b %Y %H:%M:%S %z' date -j '+%a, %d %b %Y %H:%M:%S %z'
else
date '+%a, %d %b %Y %H:%M:%S %z'
fi
} }
date_to_rfc_822() { date_to_rfc_822() {
if [[ "$OSTYPE" == "darwin"* ]]; then
date -f "%Y-%m-%dT%H:%M:%SZ" -j '+%a, %d %b %Y %H:%M:%S %z' "$1T00:00:00Z" date -f "%Y-%m-%dT%H:%M:%SZ" -j '+%a, %d %b %Y %H:%M:%S %z' "$1T00:00:00Z"
else
date '+%a, %d %b %Y %H:%M:%S %z' -d "$1T00:00:00Z"
fi
} }
get_header() { get_header() {