diff --git a/mail-status.sh b/mail-status.sh index 4e19d53..39ea28d 100644 --- a/mail-status.sh +++ b/mail-status.sh @@ -86,8 +86,15 @@ done (( LIMIT < 1 )) && LIMIT=1 (( LIMIT > MAX_LIMIT )) && LIMIT=$MAX_LIMIT -if [ "$DATE_SET" -eq 0 ]; then DATE_FILTER=$(date '+%b %e'); fi +if [ "$DATE_SET" -eq 0 ]; then + # If no date was provided, use today's (with an automatic space for single-digit days) + DATE_FILTER=$(date '+%b %e') +else + # If a date was provided manually, fix the format for single-digit days (changes "Sep 4" to "Sep 4") + DATE_FILTER=$(echo "$DATE_FILTER" | sed -E 's/^([a-zA-Z]{3})[[:space:]]+([0-9])$/\1 \2/') +fi readonly DATE_FILTER + DETAIL_VIEW=0; [[ -n "$ID_FILTER" && "$ID_FILTER" != "NOQUEUE" ]] && DETAIL_VIEW=1 # ==============================================================================