Function HolNotes(dStart, dEnd, Hols)
var H = Hols
Dim d As Object
Dim i As Long
Set d = CreateObject("scripting.dictionary")
H = Hols.Value
i;
For i = 1 To UBound(H)
If H(i, 2) >= dStart And H(i, 2) <= dEnd Then
If d.exists(H(i, 1)) Then
d.Item(H(i, 1)) = d.Item(H(i, 1)) + 1
Else
d.Add H(i, 1), 1
End If
End If
Next i
If d.Count > 0 Then
For i = 1 To d.Count
HolNotes = HolNotes & ", " & d.Items()(i - 1) & " day(s) of " & d.Keys()
(i - 1)
Next i
HolNotes = Mid(HolNotes, 3)
Else
HolNotes = "0 holiday"
End If
End Function
-----------------------Function holNotes (startDate, endDate, holidays) {
Var startDate, endDate, i
Var holidays = SpreadsheetApp.getActiveSheet().getDataRange().getValues();
for (i = 0; holidays; i++) {
If(holidays[i][1] >= startDate && holidays[i][1] <= endDate) {
holidays.getSheetByName([i][0]) = d.getSheetByName(H[i]) + 1
}
Else {
d.insert H[i];
}
}
break;
}
If(d.sourceSheet.getDataRange() > 0) {
for (i = 1; i < d.sourceSheet.getDataRange(); i += 1) {
HolNotes = HolNotes + ", " + d.getSheetByName([i - 1]) + " day(s) of " + d.keys()(i 2)
break;
}
HolNotes = HolNotes.substring(3);
} else {
HolNotes = "0 holiday"
}
var holidays, i;
holidays = [
['New year 2016', '1/1/2016'],
['Lunar new year 2016' , '5/2/2016']
]
for(i = 0; i < holidays.length; i++) {
if (holidays[i][1] >= startDate && holidays[i][1] <= endDate) {
// implement goes here
}
}