From 2563287d4a2de46239bea7d0e32b68db47ef7749 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 28 Aug 2017 12:53:54 +0000 Subject: [PATCH] Some bugfixes for the Native SQL project list git-svn-id: https://svn.libreccm.org/ccm/trunk@4940 8810af33-2d31-482b-a856-94f89814c4df --- .../sciproject/navigation/SciProjectList.java | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/ccm-sci-project-navigation/src/com/arsdigita/cms/sciproject/navigation/SciProjectList.java b/ccm-sci-project-navigation/src/com/arsdigita/cms/sciproject/navigation/SciProjectList.java index 5f64ba4a3..9ce3cd2c7 100644 --- a/ccm-sci-project-navigation/src/com/arsdigita/cms/sciproject/navigation/SciProjectList.java +++ b/ccm-sci-project-navigation/src/com/arsdigita/cms/sciproject/navigation/SciProjectList.java @@ -1,5 +1,6 @@ package com.arsdigita.cms.sciproject.navigation; +import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.navigation.Navigation; import com.arsdigita.navigation.ui.AbstractComponent; import com.arsdigita.persistence.SessionManager; @@ -238,6 +239,12 @@ public class SciProjectList extends AbstractComponent { .get(Calendar.YEAR))); projectBeginElem.addAttribute("month", Integer.toString(projectBegin .get(Calendar.MONTH))); + projectBeginElem.addAttribute( + "month-name", + projectBegin.getDisplayName(Calendar.MONTH, + Calendar.LONG, + GlobalizationHelper + .getNegotiatedLocale())); projectBeginElem.addAttribute("day", Integer.toString(projectBegin .get(Calendar.DAY_OF_MONTH))); @@ -252,28 +259,35 @@ public class SciProjectList extends AbstractComponent { if (resultSet.getDate("projectend") != null) { - final Element projectBeginElem = projectElem.newChildElement( - "project-begin"); - final Calendar projectBegin = Calendar.getInstance(); - projectBegin.setTime(resultSet.getDate("projectend")); + final Element projectEndElem = projectElem.newChildElement( + "project-end"); + final Calendar projectEnd = Calendar.getInstance(); + projectEnd.setTime(resultSet.getDate("projectend")); - projectBeginElem.addAttribute("year", Integer.toString(projectBegin - .get(Calendar.YEAR))); - projectBeginElem.addAttribute("month", Integer.toString(projectBegin - .get(Calendar.MONTH))); - projectBeginElem.addAttribute("day", Integer.toString(projectBegin - .get(Calendar.DAY_OF_MONTH))); + projectEndElem.addAttribute("year", Integer.toString(projectEnd + .get(Calendar.YEAR))); + projectEndElem.addAttribute("month", Integer.toString(projectEnd + .get(Calendar.MONTH))); + projectEndElem.addAttribute( + "month-name", + projectEnd.getDisplayName(Calendar.MONTH, + Calendar.LONG, + GlobalizationHelper + .getNegotiatedLocale())); + projectEndElem.addAttribute("day", Integer.toString(projectEnd + .get(Calendar.DAY_OF_MONTH))); - projectBeginElem.addAttribute( + projectEndElem.addAttribute( "skip-month", Boolean .toString(resultSet.getBoolean("projectend_skip_month"))); - projectBeginElem.addAttribute( + projectEndElem.addAttribute( "skip-day", Boolean.toString(resultSet.getBoolean("projectend_skip_day"))); } - final Element shortDescElem = projectElem.newChildElement("project-short-desc"); + final Element shortDescElem = projectElem.newChildElement( + "project-short-desc"); shortDescElem.setText(resultSet.getString("shortdesc")); final Element descriptionElem = projectElem.newChildElement(