Function Var Hols Dim As Object Dim Long Set
Function Var Hols Dim As Object Dim Long Set
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
}
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
}
}