Skip to content

Commit

Permalink
Update M_omDateFunctions.def
Browse files Browse the repository at this point in the history
add CalculatePayDate Function
  • Loading branch information
RaoulJacobs authored Mar 27, 2023
1 parent 0e21d19 commit e60edc0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion M_omDateFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,16 @@ End Function

Public Function EOMonth(dt As Date) As Date
EOMonth = DateSerial(year(dt), Month(dt) + 1, 0)
End Function
End Function

Public Function CalculatePayDate(dt As Date, Days As Integer, EndOfMonth As Boolean, ExtraDays As Integer) As Date

dt = DateAdd("d", Days, dt)
If EndOfMonth Then
dt = DateSerial(year(dt), Month(dt), 1)
dt = DateAdd("m", 1, dt)
dt = DateAdd("d", -1, dt)
End If
dt = DateAdd("d", ExtraDays, dt)
CalculatePayDate = dt
End Function

0 comments on commit e60edc0

Please sign in to comment.