Hi Bart,
You can use the Date Time Utils component, it has those functions for client and server side.
The component features a Demo and Try Now link where you can test your scenario and allows you to choose the first day of the week which impacts the calculus.
Hope it helps.
Regards,
João