According to Lua manual 'wday (weekday, Sunday is 1),'.

Current code to determine if a day is a weekend has 8 days in the week...