From 8cbadb61604667b407b53ee1258433994fa4765a Mon Sep 17 00:00:00 2001 From: coasteen Date: Thu, 9 Jul 2026 10:42:28 +0330 Subject: init --- config/eww/scripts/day_format.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 config/eww/scripts/day_format.sh (limited to 'config/eww/scripts/day_format.sh') diff --git a/config/eww/scripts/day_format.sh b/config/eww/scripts/day_format.sh new file mode 100755 index 0000000..a3e715a --- /dev/null +++ b/config/eww/scripts/day_format.sh @@ -0,0 +1,14 @@ +#!/bin/sh +day_of_month=$(date +"%d") +day_of_month=$(echo $day_of_month | sed 's/^0*//') +if [[ $day_of_month -ge 11 && $day_of_month -le 13 ]]; then + suffix="th" +else + case $((day_of_month % 10)) in + 1) suffix="st" ;; + 2) suffix="nd" ;; + 3) suffix="rd" ;; + *) suffix="th" ;; + esac +fi +echo "${day_of_month}${suffix}" -- cgit v1.2.3