Make rss generation cross-platform
This commit is contained in:
parent
db83ea9a70
commit
78dcfd44aa
1 changed files with 10 additions and 2 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue