text: /* eslint-disable no-bitwise, no-plusplus */
  
  (() => {
  
  Date.prototype.format = function(fmt) { 
       var o = { 
          "M+" : this.getMonth()+1,
          "d+" : this.getDate(),
          "h+" : this.getHours(),
          "m+" : this.getMinutes(),
          "s+" : this.getSeconds(),
          "q+" : Math.floor((this.getMonth()+3)/3),
          "S"  : this.getMilliseconds()
      }; 
      if(/(y+)/.test(fmt)) {
              fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
      }
       for(var k in o) {
          if(new RegExp("("+ k +")").test(fmt)){
               fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
           }
       }
      return fmt;
  } 
  
  
    const dependencyLibrary = new PlugIn.Library(new Version('1.0'));
  
    dependencyLibrary.log = async function log(message, title = 'Log') {
      const a = new Alert(title, message);
      a.addOption('OK');
      await a.show();
    };
  
  
    dependencyLibrary.getCompletedTasksForThisWeek = function getCompletedTasksForThisWeek() {
      
  	var thisweek = {}; 
  	var date = new Date(); 
  	// start day
  	var dayNo = date.getDay();
  	
  	if(dayNo == 0) {
  		dayNo = 7;
  	}
  	
  	date.setDate(date.getDate() - dayNo + 1); 
  	thisweek.start_day = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate() ; 
  	// end day
  	date.setDate(date.getDate() + 7); 
  	thisweek.end_day = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate(); 
  
   var start_Day = new Date(thisweek.start_day);
  	  var end_Day = new Date(thisweek.end_day);
  	var weeklyCompletedTasks = [];
  console.log(thisweek.start_day);
  console.log(thisweek.end_day);
  	
    for(i=0;i<flattenedTasks.length;i++){
      var task = flattenedTasks[i];
      if(task.completed){
        var completeDate = task.completionDate;
        if (completeDate>=start_Day && completeDate<=end_Day) {
          weeklyCompletedTasks.push(task);
        }
      }
    }
  	
      return weeklyCompletedTasks;
    };
  
  
    return dependencyLibrary;
  })();
  