const self = {
    name: 'sotd.cr-end'
};

exports.check = function (sr, done) {
    var dates = sr.getFeedbackDueDate()
    ,   res   = dates[0]
    ;
    if (dates.length === 0) sr.error(self, "not-found");
    if (dates.length > 1) {
      res = new Date(Math.min.apply(null,dates));
      sr.warning(self, "multiple-found");
    }
    sr.info(self, "date-found", {date: res.toDateString()});
    done();
};

@@ -82,11 +82,13 @@
     
-var
+const
  dat
@@ -119,38 +119,8 @@
 te()
-%0A    ,   res   = dates%5B0%5D%0A    
 ;%0A  
@@ -117,32 +117,38 @@
 Date();%0A    if (
+0 === 
 dates.length ===
@@ -147,15 +147,17 @@
 ngth
- === 0)
+)%0A       
  sr.
@@ -186,20 +186,58 @@
 %22);%0A    
-if (
+else %7B%0A        var res;%0A        if (1 === 
 dates.le
@@ -244,16 +244,16 @@
 ngth
- %3E 1) %7B%0A
+)%0A      
     
@@ -264,46 +264,39 @@
 s = 
-new Date(Math.min.apply(null,dates));%0A
+dates%5B0%5D;%0A        else %7B%0A      
     
@@ -341,10 +341,66 @@
     
-%7D%0A
+        res = new Date(Math.min(...dates));%0A        %7D%0A    
     
@@ -456,16 +456,22 @@
 ng()%7D);%0A
+    %7D%0A
     done

Fix RTE: undefined property