1

The below code returns sunday instead of monday for week start- can someone please help me troubleshoot

function myFunction() {
 var curr = new Date();
  
var first = (curr.getDate() - curr.getDay()) ;
  
var Monday = Utilities.formatDate(new Date(curr.setDate(first)), "UTC", "YYYY-MM-dd");
  
var sh = SpreadsheetApp.getActiveSheet();
  
 sh.getRange("F4").setValue(Monday) ;

}
Rubén
  • 34,714
  • 9
  • 70
  • 166
Gil Colin
  • 11
  • 1
  • For your reference in your future posts, please do try to search the question first before posting. Try google, then stackoverflow. – NightEye Mar 07 '22 at 03:30

0 Answers0