Function HolNotes

Embed Size (px)

Citation preview

  • 8/19/2019 Function HolNotes

    1/2

    Function HolNotes(dStart, dEnd, Hols)

      var H = Hols

      Dim d As Object

      Dim i As Long

     

    Set d = reateObject(!scri"ting#dictionar$!)

      H = Hols#%aluei&

    For i = ' o *ound(H)

      + H(i, -) .= dStart And H(i, -) /= dEnd 0en

      + d#e1ists(H(i, ')) 0en

      d#+tem(H(i, ')) = d#+tem(H(i, ')) 2 '

      Else

      d#Add H(i, '), '

      End +

      End +

      Ne1t i

      + d#ount . 3 0en

      For i = ' o d#ount

      HolNotes = HolNotes 4 !, ! 4 d#+tems()(i 5 ') 4 ! da$(s) o ! 4 d#6e$s()

    (i 5 ')  Ne1t i

      HolNotes = 7id(HolNotes, 8)

      Else

      HolNotes = !3 0olida$!

      End +

    End Function

    ------------------------

    Function holNotes (startDate, endDate, holidays) {

      Var startDate, endDate, i  Var holidays = SpreadsheetApp.getActiveSheet().getDataange().getValues()!

      "or (i = #! holidays! i$$) {  %"(holidays&i'&' = startDate ** holidays&i'&' += endDate) {  holidays.getSheetyNae(&i'') = d.getSheetyNae(&i') $

      /

      0lse {

      d.insert &i'!  /

      /

      1rea2!  /

      %"(d.sourceSheet.getDataange() #) {

      "or (i = ! i + d.sourceSheet.getDataange()! i $= ) {  olNotes = olNotes $ 3, 3 $ d.getSheetyNae(&i - ') $ 3 day(s) o" 3 $ d.2eys()(i -

    4)

      1rea2!

      /  olNotes = olNotes.su1string(5)!

      / else {

      olNotes = 3# holiday3

  • 8/19/2019 Function HolNotes

    2/2

      /

    var holidays, i!

    holidays = &

      &6Ne7 year 4#86, 6994#86',  &6:unar ne7 year 4#86 , 6;9494#86'

    '

    "or(i = #! i + holidays.length! i$$) {

      i" (holidays&i'&' = startDate ** holidays&i'&' += endDate) {

      99 ipleent goes here

      //