On 24/01/2026 18:47, Sylvestre Ledru wrote:
Hello

The attached patch improved the date tests with other locales with different
calendars!

Cheers,

That's hardcoding the current values from the locale database though.
This may vary over time/systems.

I wonder could we lookup the DB with something like
(untested off the top of my head):

march=$(LC_TIME=fa_IR.UTf-8 locale mon | cut -d';' 
-f3)mar=$(LC_TIME=fa_IR.UTf-8 locale abmon | cut -d';' -f3)
friday=$(LC_TIME=fa_IR.UTf-8 locale day | cut -d';' -f6)
fri=$(LC_TIME=fa_IR.UTf-8 locale abday | cut -d';' -f6)
if test "$march" && test "$mar" && test "$friday" && test "$fri"; then
  printf '%s %s %s %s\n' "$friday" "$fri" "$mar" "$march" > exp
  LC_TIME=fa_IR.UTF-8 date -d "$specific_date" "+%A %a %b %B" > out || fail=1
  compare exp out || fail=1
fi

thanks,
Padraig

Reply via email to