日期:2014-05-16 浏览次数:20387 次
var beginIndex = (newsObjectDefault.pageIndex - 1) * newsObjectDefault.pageSize;请问先把要那个效果应该怎么改这个newsDateTime
var endIndex = (newsObjectDefault.pageIndex == sumPages && rest < newsObjectDefault.pageSize) ? (beginIndex + rest) : (beginIndex + newsObjectDefault.pageSize);
for (var i = beginIndex; i < endIndex; i++) {
var newsRow = news[i];
var newsDateTime = newsRow.date.substr(0, newsRow.date.indexOf(" "));
var newsTitle = newsRow.title;
newsType = getCmsCategory(newsRow.typename);
htmlContents += newsObjectDefault.newsFormat.replace("{0}", newsDateTime)
.replace("{1}", newsType)
.replace("{2}", newsRow.id)
.replace("{3}", newsTitle.length > 22 ? newsTitle.substr(0, 22) : newsTitle);
}
}
$(".box_news").empty().html(htmlContents);
var newsDateTime = newsRow.date.substr(0, newsRow.date.indexOf(" "));
var arr = newsDateTime.split('/');
newsDateTime = arr[2] + '-' + arr[0] + '-' + arr[1];