Manage Learn to apply best practices and optimize your operations.

Date Adjustment To Weekday (Script)

This function accepts two arguments: 1) The date that you want to adjust,and 2)
The number of days you want to adjust the date by. The function is useful when
the user needs a date adjusted, but the date must be a weekday. This function
does not take into account Holidays.
Function FindWeekDay (tempdate As String, daysadjust As Integer) As String
Dim wd As Integer ' Weekday
Dim date1 As New NotesDateTime (tempdate)
date1.Adjustday(daysadjust) ' Adjust the 'date by the number of days
specified (Second 'argument).
wd = Weekday(date1.lslocaltime) ' Number for 'the day of the week.

While wd = 1 Or wd = 7 ' If the day is Sat '(7) or Sun (1)
date1.Adjustday(1) 'then increment the 'date the next Monday.
wd = Weekday(date1.lslocaltime) ' Reset 'the weekday variable

'If wd is not 1 or 7 the adjusted date is returned

FindWeekDay = date1.lslocaltime

End Function

Dig Deeper on Lotus Notes Domino User Settings



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury