|
|
Дата на Начало и Конец недели относительно указанной даты
Public Function esDateToWeekPeriod(byDate As Date) As String
Dim intD As Integer
On Error GoTo DateToWeekPeriodErr
intD = DatePart("w", byDate, vbMonday)
esDateToWeekPeriod = Format(byDate - intD + 1, "dd.mm.yyyy") & "-"
esDateToWeekPeriod = esDateToWeekPeriod & _
Format(byDate + (7 - intD), "dd.mm.yyyy")
Exit Function
DateToWeekPeriodErr:
esDateToWeekPeriod = "#ERR#"
End Function
|
|