举个例子:
要增加一个这样的[content:date style=AAA-d-yyy]时间样式
在inc/AspCms_MainClass.asp中找到
if str="content" or str="aboutcontent" or str="news" or str="product" or str="down" or str="pic" then
继续向下
case "date"
timestyle = parseArr(fieldArr)("style") : if isNul(timestyle) then timestyle = "m-d"
select case timestyle
case "yy-m-d"
nloopstr = replace(nloopstr,matchfield.value,FormatDate(rsObj("AddTime"),1))
case "y-m-d"
nloopstr = replace(nloopstr,matchfield.value,FormatDate(rsObj("AddTime"),2))
case "m-d"
nloopstr = replace(nloopstr,matchfield.value,FormatDate(rsObj("AddTime"),3))
'增加一个,参数设为10,case设为AAA-d-yyy,对应标签中的style
case "AAA-d-yyy"
nloopstr = replace(nloopstr,matchfield.value,FormatDate(rsObj("AddTime"),10))
end select
然后在inc/AspCms_CommonFun.asp中找到
'转换时间
Function formatDate(Byval t,Byval ftype)
在end select上面添加一个case 10
case 10
dim mArray:mArray = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct", "Nov","Dec")
formatDate=mArray(clng(m)-1)&" "&d&"."&y
end select
ok 可以了
inc/AspCms_MainClass.asp文件1490行
- select case timestyle
- case "yy-m-d"
- nloopstr = replace(nloopstr,matchfield.value,FormatDate(DateArray(5,i),1))
- case "y-m-d"
- nloopstr = replace(nloopstr,matchfield.value,FormatDate(DateArray(5,i),2))
- case "m-d"
- nloopstr = replace(nloopstr,matchfield.value,FormatDate(DateArray(5,i),3))
- case "yy-mm-dd"
- nloopstr = replace(nloopstr,matchfield.value,FormatDate(DateArray(5,i),4))
-
- Function FormatDate(Byval t,Byval ftype)
- select case cint(ftype)
- case 1
- FormatDate = year(t)&"-"&month(t)&"-"&day(t)
- case 2
- FormatDate = right(year(t),2)&"-"&month(t)&"-"&day(t)
- case 3
- FormatDate = month(t)&"-"&day(t)
- case 4
- dim tempMonth
- tempMonth = right(month(t),2)
- if CInt(tempMonth) < 10 then tempMonth="0"&tempMonth
- dim tempDay
- tempDay = right(day(t),2)
- if CInt(tempDay) < 10 then tempDay="0"&tempDay
- FormatDate = right(year(t),2)&"-"&tempMonth&"-"&tempDay
- end select
- End Function
- Function FormatDate(Byval t,Byval ftype)