<%@ page import="org.apache.log4j.*" %> <%@ page import="com.ecyrd.jspwiki.*" %> <%@ page import="java.util.*" %> <%@ page import="java.text.*" %> <%! public void jspInit() { wiki = WikiEngine.getInstance( getServletConfig() ); } public boolean isSameDay( Date a, Date b ) { Calendar aa = Calendar.getInstance(); aa.setTime(a); Calendar bb = Calendar.getInstance(); bb.setTime(b); return( aa.get( Calendar.YEAR ) == bb.get( Calendar.YEAR ) && aa.get( Calendar.DAY_OF_YEAR ) == bb.get( Calendar.DAY_OF_YEAR ) ); } Category log = Category.getInstance("JSPWiki.RecentChanges"); WikiEngine wiki; %> <% Collection list = null; list = wiki.getRecentChanges(); // This is required by PageHeader.jsp String pagereq = "Recent Changes"; %> <%=wiki.getApplicationName()%> Recent Changes <%@ include file="cssinclude.js" %>
<%@ include file="LeftMenu.jsp" %>

<%@ include file="LeftMenuFooter.jsp" %>

<%@ include file="PageHeader.jsp" %> <% if( list != null ) { %> <% Date olddate = new Date(0); SimpleDateFormat fmt = new SimpleDateFormat( "dd.MM.yyyy" ); SimpleDateFormat tfmt = new SimpleDateFormat( "HH:mm:ss" ); for( Iterator i = list.iterator(); i.hasNext(); ) { WikiPage pageref = (WikiPage) i.next(); Date lastmod = pageref.getLastModified(); if( !isSameDay( lastmod, olddate ) ) { %> <% olddate = lastmod; } %> <% } %>
<%=fmt.format(lastmod)%>
<%=pageref.getName()%> <%=tfmt.format(lastmod)%>
<% } %>