1. 前台日期显示格式和操作
var startdatetime = new Date( data_record[item_record] ); //开始时间
var days = data_record.daycount ? data_record.daycount : 1; //持续天数
var enddatetime = new Date();
enddatetime = new Date( startdatetime.valueOf() + days*24*60*60*1000 );
startdatetime = String( startdatetime.getFullYear() )+ '年'+ String( startdatetime.getMonth() )+'月'+startdatetime.getDay()+'日';
enddatetime = String( enddatetime.getFullYear() )+ '年'+ String( enddatetime.getMonth() )+'月'+enddatetime.getDay()+'日';
2.js生成table
for( var item_fieldset in display_fields){ //遍历配置
for(var item_record in data_record){ //遍历list结构
if(item_fieldset == item_record){ //如果字段匹配
var _row = _table.insertRow();
if(display_fields[item_fieldset].supercaption){ //如果有二级标题 如"公务活动信息"
cell_supercaption = document.createElement("td");
cell_supercaption.innerHTML = display_fields[item_fieldset].supercaption;
_row.appendChild(cell_supercaption);
cell_fieldvalue = document.createElement("td");
cell_fieldvalue.style.padding = '0';
_row.appendChild(cell_fieldvalue);<pre name="code" class="javascript"><div><span> </span> }<span> </span></div><div><span> </span>}</div><div><span style="white-space:pre"> </span>}</div>}