IDEMPIERE-2043 DB.To_Char: Formatting for display type Date not implemented for PostgreSQL
This commit is contained in:
parent
68b8172603
commit
93bf1a85a6
|
@ -51,6 +51,7 @@ import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Ini;
|
import org.compiere.util.Ini;
|
||||||
|
import org.compiere.util.Language;
|
||||||
import org.compiere.util.Trx;
|
import org.compiere.util.Trx;
|
||||||
import org.compiere.util.Util;
|
import org.compiere.util.Util;
|
||||||
import org.jfree.io.IOUtils;
|
import org.jfree.io.IOUtils;
|
||||||
|
@ -440,10 +441,19 @@ public class DB_PostgreSQL implements AdempiereDatabase
|
||||||
**/
|
**/
|
||||||
public String TO_CHAR (String columnName, int displayType, String AD_Language)
|
public String TO_CHAR (String columnName, int displayType, String AD_Language)
|
||||||
{
|
{
|
||||||
StringBuilder retValue = new StringBuilder("CAST (");
|
StringBuilder retValue = null;
|
||||||
retValue.append(columnName);
|
if (DisplayType.isDate(displayType)) {
|
||||||
retValue.append(" AS Text)");
|
retValue = new StringBuilder("TO_CHAR(");
|
||||||
|
retValue.append(columnName)
|
||||||
|
.append(",'")
|
||||||
|
.append(Language.getLanguage(AD_Language).getDBdatePattern())
|
||||||
|
.append("')");
|
||||||
|
} else {
|
||||||
|
retValue = new StringBuilder("CAST (");
|
||||||
|
retValue.append(columnName);
|
||||||
|
retValue.append(" AS Text)");
|
||||||
|
}
|
||||||
|
return retValue.toString();
|
||||||
// Numbers
|
// Numbers
|
||||||
/*
|
/*
|
||||||
if (DisplayType.isNumeric(displayType))
|
if (DisplayType.isNumeric(displayType))
|
||||||
|
@ -463,7 +473,6 @@ public class DB_PostgreSQL implements AdempiereDatabase
|
||||||
}
|
}
|
||||||
retValue.append(")");
|
retValue.append(")");
|
||||||
//*/
|
//*/
|
||||||
return retValue.toString();
|
|
||||||
} // TO_CHAR
|
} // TO_CHAR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue