|
真正的公农历转换类for VB(11) For i = 0 To b If wHolidayInfo(i).Month = mvarsMonth Then '当月份相当时 w = WeekDay(mvarDate) If wHolidayInfo(i).WeekDay = w Then '仅当星期几也相等时 FirstDay = mvarsMonth & "/" & 1 & "/" & mvarsYear '取当月第一天 If (DateDiff("ww", FirstDay, mvarDate) = wHolidayInfo(i).WeekAtMonth) Then tempStr = wHolidayInfo(i).HolidayName End If End If End If Next wHoliday = tempStr End Property Public Property Get lHoliday() As String Dim i As Long Dim b As Long Dim tempStr As String Dim oy As Long Dim odate As Date Dim ndate As Date tempStr = "" b = UBound(lHolidayInfo) If mvarlMonth = 12 And (mvarlDay = 29 Or mvarlDay = 30) Then '保 oy = mvarlYear '保存农历年数 odate = mvarDate ndate = mvarDate + 1 Call sInitDate(Year(ndate), Month(ndate), Day(ndate)) '计算第二天的属性 If oy = mvarlYear - 1 Then '如果农历年数增加了1 tempStr = "除夕" Call sInitDate(Year(odate), Month(odate), Day(odate)) '恢复到今天原有数据
|