pvollenweider 2005/06/08 14:02:57 CEST
Modified files: (Branch: JAHIA-4-1-BRANCH)
src/view/jsp/include blog_declarations.inc
Log:
Fix bug date
Revision Changes Path
1.1.2.12 +7 -6
corporate_portal_templates/src/view/jsp/include/blog_declarations.inc
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_declarations.inc.diff?r1=1.1.2.11&r2=1.1.2.12&f=h
Index: blog_declarations.inc
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/include/blog_declarations.inc,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -r1.1.2.11 -r1.1.2.12
--- blog_declarations.inc 1 Jun 2005 12:40:49 -0000 1.1.2.11
+++ blog_declarations.inc 8 Jun 2005 12:02:57 -0000 1.1.2.12
@@ -3,10 +3,10 @@
org.apache.log4j.Logger logger,boolean displayAllSiteEntries,
JahiaData jData,HttpServletRequest request)
throws JahiaException {
- SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yy kk:mm" );
+ SimpleDateFormat sdf = new SimpleDateFormat( "dd/MMM/yyyy kk:mm z+2" );
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
//Calendar cal = new GregorianCalendar(new Locale("CH_fr"));
- Calendar cal = new GregorianCalendar();
+ Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
long now = cal.getTimeInMillis();
if (t != -1){
cal.setTime(new Date(t));
@@ -28,11 +28,12 @@
cal.set( Calendar.HOUR_OF_DAY, 0 );
cal.set( Calendar.MINUTE, 0);
cal.set( Calendar.SECOND, 0);
+ cal.add( Calendar.SECOND, -1);
Date lowerVal = cal.getTime();
+ cal.add( Calendar.SECOND, 1);
cal.add( Calendar.MONTH, 1 );
Date upperVal = cal.getTime();
cal.add( Calendar.MONTH, -1 );
- cal.set( Calendar.SECOND, 1);
logger.debug("printMonthView -> Filter from " +
sdf.format( (new Date(lowerVal.getTime())) ) + " to " +
sdf.format( (new Date(upperVal.getTime())) ));
@@ -56,7 +57,7 @@
}
request.setAttribute("entries_filter_handler",containerFilters);
}
- Hashtable dayHasEntry = new Hashtable();
+ Vector dayHasEntry = new Vector();
JahiaContainerList entries = jData.containers().getContainerList(
"entries" );
if (entries != null) {
entries.setIsContainersLoaded(false);
@@ -70,7 +71,7 @@
entryDate.setTime(new Date(dateLong));
int entryDay = entryDate.get(Calendar.DAY_OF_MONTH);
//logger.debug("Thers is an entry on day " + entryDay);
- dayHasEntry.put(Integer.toString(entryDay),"true");
+ dayHasEntry.add(new Integer(entryDay));
} catch (NumberFormatException nfe) {
}
@@ -148,7 +149,7 @@
while( cal.get( Calendar.MONTH ) == currMonth ) {
int d = cal.get( Calendar.DAY_OF_MONTH );
- boolean hasEntry = dayHasEntry.get( Integer.toString(d))!=null;
+ boolean hasEntry = dayHasEntry.contains( new Integer(d));
weekOfYear = cal.get(Calendar.WEEK_OF_YEAR);
dayDate = cal.getTimeInMillis();
if (cal.get( Calendar.DAY_OF_WEEK ) == Calendar.MONDAY) {