WeekDay BASIC function documentation  only lists one argument. In fact, it takes second optional argument , which is consistent with documentation available for corresponding VBA function .
The task is to provide the missing documentation in .
FTR: the optional second argument was implemented at the same time as the function itself - in 2004: https://gerrit.libreoffice.org/plugins/gitiles/core/+/3aa55b592d25bf8b0bc0323dfbd5c905fd2f0e91.
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":
tdf#131368, tdf#141474 Document WeekDay Basic function