formatGMT( ‘EEEE’ ) can be used to return the week using Salesforce Apex.
Sample Code:
String strDate = '2022-12-16';
Date dateValue = Date.valueOf( strDate );
System.debug( 'dateValue is ' + dateValue );
Datetime tempDateTime = ( DateTime )dateValue;
String dayOfWeek = tempDateTime.formatGMT( 'EEEE' );
System.debug( 'dayOfWeek is ' + dayOfWeek );
Output: