fixes #39 Unify format of datefields on forms
http://bitbucket.org/idempiere/idempiere/issue/39
This commit is contained in:
parent
26337eddb8
commit
f1dc9e783c
|
@ -304,9 +304,7 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
|
||||||
div.appendChild(createdQLabel);
|
div.appendChild(createdQLabel);
|
||||||
row.appendChild(div);
|
row.appendChild(div);
|
||||||
row.appendChild(createdQFrom);
|
row.appendChild(createdQFrom);
|
||||||
createdQFrom.setWidth("100%");
|
|
||||||
row.appendChild(createdQTo);
|
row.appendChild(createdQTo);
|
||||||
createdQTo.setWidth("100%");
|
|
||||||
|
|
||||||
div = new Div();
|
div = new Div();
|
||||||
div.setAlign("center");
|
div.setAlign("center");
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
package org.adempiere.webui.component;
|
package org.adempiere.webui.component;
|
||||||
|
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
|
import org.compiere.util.DisplayType;
|
||||||
|
import org.compiere.util.Env;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
|
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
|
||||||
|
@ -30,6 +34,11 @@ public class Datebox extends org.zkoss.zul.Datebox
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -5890574778856946570L;
|
private static final long serialVersionUID = -5890574778856946570L;
|
||||||
|
|
||||||
|
public Datebox() {
|
||||||
|
super();
|
||||||
|
setFormat(DisplayType.getDateFormat(AEnv.getLanguage(Env.getCtx())).toPattern());
|
||||||
|
}
|
||||||
|
|
||||||
public void setEnabled(boolean enabled)
|
public void setEnabled(boolean enabled)
|
||||||
{
|
{
|
||||||
this.setReadonly(!enabled);
|
this.setReadonly(!enabled);
|
||||||
|
|
|
@ -280,7 +280,6 @@ public class WListItemRenderer implements ListitemRenderer, EventListener, Listi
|
||||||
if (isCellEditable)
|
if (isCellEditable)
|
||||||
{
|
{
|
||||||
Datebox datebox = new Datebox();
|
Datebox datebox = new Datebox();
|
||||||
datebox.setFormat(dateFormat.toPattern());
|
|
||||||
datebox.setValue(new Date(((Timestamp)field).getTime()));
|
datebox.setValue(new Date(((Timestamp)field).getTime()));
|
||||||
datebox.addEventListener(Events.ON_CHANGE, this);
|
datebox.addEventListener(Events.ON_CHANGE, this);
|
||||||
listcell.appendChild(datebox);
|
listcell.appendChild(datebox);
|
||||||
|
|
|
@ -106,7 +106,6 @@ public class WDateEditor extends WEditor implements ContextMenuListener
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
getComponent().setFormat(DisplayType.getDateFormat(AEnv.getLanguage(Env.getCtx())).toPattern());
|
|
||||||
popupMenu = new WEditorPopupMenu(false, false, true);
|
popupMenu = new WEditorPopupMenu(false, false, true);
|
||||||
popupMenu.addMenuListener(this);
|
popupMenu.addMenuListener(this);
|
||||||
if (gridField != null && gridField.getGridTab() != null)
|
if (gridField != null && gridField.getGridTab() != null)
|
||||||
|
|
|
@ -98,7 +98,6 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
getComponent().setDateFormat(DisplayType.getDateFormat());
|
|
||||||
popupMenu = new WEditorPopupMenu(false, false, true);
|
popupMenu = new WEditorPopupMenu(false, false, true);
|
||||||
popupMenu.addMenuListener(this);
|
popupMenu.addMenuListener(this);
|
||||||
if (gridField != null && gridField.getGridTab() != null)
|
if (gridField != null && gridField.getGridTab() != null)
|
||||||
|
|
|
@ -174,7 +174,7 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
Div div = new Div();
|
Div div = new Div();
|
||||||
div.appendChild(fDateFrom);
|
div.appendChild(fDateFrom);
|
||||||
div.appendChild(fTimeFrom);
|
div.appendChild(fTimeFrom);
|
||||||
fTimeFrom.setStyle("margin-left: 5px");
|
fTimeFrom.setStyle("margin-left: 1px");
|
||||||
row.appendChild(div);
|
row.appendChild(div);
|
||||||
rows.appendChild(row);
|
rows.appendChild(row);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue