This is also default functionality if you choose to display the view as 'Calendar View' which most likely would have been the easiest and probably the best result based on the content description above...
For weekdays you can try @Weekday([datetimevalue])
For week numbers it will be a little less 'scientific' if you don't use the calendar view (default available in that view type)
Something like this could do the trick:
tmp := @Modulo(@Integer((@Date([documentdate]) - @Date([12/31/1999])) / 84600) / 7)); 52) + 1;
Need to try and see how it will work in practicality. But the idea is to use a reference date as 'anchor' and subtract this from the document date and divide by 84600 to get number of days. Divide on 7 and cast to Integer (@Round may be better...), then use a Modulo operation to get the weeknumber since it could stretch over years, and add 1 to the value so weeknumbers will be between 1 and 52. There is no 'guarantees' with this formula, and adjustments will be needed to make it as exact as possible...
Brgds,
TrooDOS