IDEMPIERE-4487: Fixing issue that date time editor not showing time part. (#288)

This commit is contained in:
Deepak Pansheriya 2020-10-15 22:47:19 +05:30 committed by GitHub
parent 3fa16637aa
commit b8e9e455f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@
package org.adempiere.webui.editor;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
@ -143,7 +144,7 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener
{
// Elaine 2008/07/25
if(getComponent().getValue() == null) return null;
return Timestamp.valueOf(getComponent().getDatebox().getValue().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
return Timestamp.valueOf(getComponent().getValue().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
//
}
@ -157,7 +158,9 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener
}
else if (value instanceof Timestamp)
{
getComponent().getDatebox().setValueInLocalDateTime(((Timestamp)value).toLocalDateTime());
LocalDateTime localTime =((Timestamp)value).toLocalDateTime();
getComponent().getDatebox().setValueInLocalDateTime(localTime);
getComponent().getTimebox().setValueInLocalDateTime(localTime);
oldValue = (Timestamp)value;
}
else