Changeset 1498


Ignore:
Timestamp:
Jan 12, 2012, 10:53:12 AM (10 years ago)
Author:
Martin Svensson
Message:

References #339 Added information about latest registration to the table-header

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp

    r1495 r1498  
    175175    var reportTable = getReportTable();
    176176    var sdString = report.beginDate;
    177     var edString = report.endDate;   
     177    var edString = report.endDate;
     178    var ldString = report.latestDate;
    178179    var startDate = new Date();
    179180    startDate.setYear(sdString.substr(0,4));
     
    184185    endDate.setMonth(edString.substr(4,2)-1);
    185186    endDate.setDate(edString.substr(6));
     187    var latestDate;
     188    if (ldString != null)
     189    {
     190      latestDate = new Date();
     191      latestDate.setYear(ldString.substr(0,4));
     192      latestDate.setMonth(ldString.substr(4,2)-1);
     193      latestDate.setDate(ldString.substr(6));
     194    }   
     195   
    186196    var viewType = report.viewType;   
    187197 
     
    222232     
    223233    // Set table header
    224     headerText += '\n(' + startDate.getFullYear()+'-';
     234    headerText += ' (' + startDate.getFullYear()+'-';
    225235    if ((startDate.getMonth()+1) < 10) headerText += '0' + (startDate.getMonth()+1);
    226236    else headerText += (startDate.getMonth()+1);
     
    235245    if (endDate.getDate() < 10) headerText += '0' + endDate.getDate();
    236246    else headerText += endDate.getDate();
    237     headerText += ')';   
     247    headerText += ')';
     248    if (latestDate != null)
     249    {
     250      headerText += '\nLast registration ' + latestDate.getFullYear();
     251      headerText += '-';
     252      if ((latestDate.getMonth()+1) < 10) headerText += '0';
     253      headerText += (latestDate.getMonth()+1);
     254      headerText += '-';
     255      if (latestDate.getDate()<10) headerText += '0';
     256      headerText += latestDate.getDate();
     257    }   
    238258    headerRow.appendChild(getTableCellElement(headerText, 'reportheader', (numCols+3)));
    239259   
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SampleReportServlet.java

    r1495 r1498  
    182182          jsonReport.put("beginDate", date2StringConverter.convert(startDate));
    183183          jsonReport.put("endDate", date2StringConverter.convert(endDate));
     184          jsonReport.put("latestDate", date2StringConverter.convert(latestDate));
    184185          json.put("report", jsonReport);
    185186        }
Note: See TracChangeset for help on using the changeset viewer.