Private Sub class_initialize() d_ = date() '默認當前日期 firstdayofweek_ = 2 'vbMonday firstweekofyear_ = 1 '由 1 月 1 日所在的星期開始。 End Sub
'屬性 setDate 日期 Public Property Let setDate(value) On Error Resume Next If IsNumeric(value) Then value = Cint(value) If len(value)< 3 Then value = "20" & right("0"&value,2) value = value & "-1" End If d_ = cDate(value) End Property
'屬性 firstweekofyear 每年的第一周(詳細設置請參照VBS手冊) Public Property Let firstweekofyear(value) firstweekofyear_ = cInt(value) End Property