Branch for 2.3.x tree
git-svn-id: https://svn.libreccm.org/ccm/trunk@3532 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c56db8ae78
commit
0f2473a873
|
|
@ -33,8 +33,7 @@ import org.apache.log4j.Logger;
|
||||||
*/
|
*/
|
||||||
public class ConfigError extends Error {
|
public class ConfigError extends Error {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger
|
private static final long serialVersionUID = 5224480607138738741L;
|
||||||
(ConfigError.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new configuration error with the content
|
* Constructs a new configuration error with the content
|
||||||
|
|
|
||||||
|
|
@ -25,34 +25,34 @@ import java.util.Date;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An alternate formatter for java.util.Date objects,
|
* An alternate formatter for java.util.Date objects, outputing the date in
|
||||||
* outputing the date in 'medium' format. The time
|
* 'medium' format. The time is ommitted.
|
||||||
* is ommitted.
|
|
||||||
*
|
*
|
||||||
* @author unkknown
|
* @author unkknown
|
||||||
* @author Sören Bernstein <quasi@quasiweb.de>
|
* @author Sören Bernstein <quasi@quasiweb.de>
|
||||||
*/
|
*/
|
||||||
public class DateFormatter implements Formatter {
|
public class DateFormatter implements Formatter {
|
||||||
|
|
||||||
private static DateFormatterConfig m_config;
|
private static DateFormatterConfig m_config;
|
||||||
|
|
||||||
public static final DateFormatterConfig getConfig() {
|
public static final DateFormatterConfig getConfig() {
|
||||||
if (m_config == null) {
|
if (m_config == null) {
|
||||||
m_config = new DateFormatterConfig();
|
m_config = new DateFormatterConfig();
|
||||||
m_config.load();
|
m_config.load();
|
||||||
}
|
}
|
||||||
return m_config;
|
return m_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(Object value) {
|
public String format(Object value) {
|
||||||
Date date = (Date)value;
|
Date date = (Date) value;
|
||||||
|
|
||||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||||
|
|
||||||
DateFormat format = DateFormat.getDateInstance
|
DateFormat format = DateFormat
|
||||||
(DateFormat.MEDIUM, locale);
|
.getDateInstance(DateFormat.MEDIUM, locale);
|
||||||
|
|
||||||
return format.format(date);
|
return format.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue