Closed hp-pepster closed 1 year ago
Hi, thank you for your interest. I think it could be done just by using string.format
. Something like this:
for x = 0, 6 do
notifytable[#notifytable + 1] = string.format("%-3s ", os.date("%a",
os.time { year = 2006, month = 1, day = x + cal.week_star }):sub(1, utf8.offset(1, 3))
end
Can you please test it? Plus, I admit that the code is a bit too compressed, so any reformatting is welcome.
EDIT: Also, if you can get rid of the utf8
dependency, that would solve #503 too.
I'll look into it after work. Seems like string.format() does not support right alignment, which leads to a strange format
I tested it on my system and also tested for this bug https://github.com/lcpz/lain/issues/476 which I assume was the reason for the utf-8 fix.
Maybe @Czarnodziej or @arielnmz can test if my commits don't break it again.
Looks good to me. Utf-8 names working properly with this commit on Lua 5.4.4
If the day names do not consist of three characters, the alignment is off (see https://github.com/lcpz/lain/issues/522)