From 627ac1bd4dfc05f923edd500dd63ae07c2c87dd0 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 31 Jul 2008 22:02:34 +0000 Subject: [PATCH] Fix [ 2034366 ] Firefox 3 problem with #Date context Better solution - it's not about firefox, but the Timestamp.toString sometimes returns one digit nanos, and sometimes more (I suppose this depend on the op. sys) --- base/src/org/compiere/util/Env.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/base/src/org/compiere/util/Env.java b/base/src/org/compiere/util/Env.java index ab89fa786d..a3214c4fc3 100644 --- a/base/src/org/compiere/util/Env.java +++ b/base/src/org/compiere/util/Env.java @@ -235,8 +235,8 @@ public final class Env else { // JDBC Format 2005-05-09 00:00:00.0 String stringValue = value.toString(); - // Chop off .0 - stringValue = stringValue.substring(0, stringValue.length()-2); + // Chop off .0 (nanos) + stringValue = stringValue.substring(0, stringValue.indexOf(".")); ctx.setProperty(context, stringValue); s_log.finer("Context " + context + "==" + stringValue); } @@ -308,8 +308,8 @@ public final class Env else { // JDBC Format 2005-05-09 00:00:00.0 String stringValue = value.toString(); - // Chop off .0 - stringValue = stringValue.substring(0, stringValue.length()-2); + // Chop off .0 (nanos) + stringValue = stringValue.substring(0, stringValue.indexOf(".")); ctx.setProperty(WindowNo+"|"+context, stringValue); s_log.finer("Context("+WindowNo+") " + context + "==" + stringValue); } @@ -743,8 +743,6 @@ public final class Env // timestamp requires time if (s.trim().length() == 10) s = s.trim() + " 00:00:00.0"; - else if (s.trim().length() == 20 && s.trim().endsWith(".")) // FF3 returning date without the ending 0 - s = s.trim() + "0"; else if (s.indexOf('.') == -1) s = s.trim() + ".0";