diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-02-19 14:54:02 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-02-19 14:54:02 +0000 |
commit | ac6e88b05b67e4297ed9b7a25857026ad42cdd70 (patch) | |
tree | 50db007a78ee34b333bf8475e1fca4257513c9ab /src/com/itmill/toolkit/terminal | |
parent | bc1103da99cfc5d0cfebf5bf55a52a33af35e3e9 (diff) | |
download | vaadin-framework-ac6e88b05b67e4297ed9b7a25857026ad42cdd70.tar.gz vaadin-framework-ac6e88b05b67e4297ed9b7a25857026ad42cdd70.zip |
Fix for #2629 - Internal Error when invalid date is entered into textfield
svn changeset:6909/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/terminal')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java index 6c51b33b67..c7e48f6afd 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java @@ -139,8 +139,15 @@ public class ITextualDate extends IDateField implements Paintable, Field, if (sender == text) {
if (!text.getText().equals("")) {
try {
- date = DateTimeFormat.getFormat(getFormatString()).parse(
- text.getText());
+ DateTimeFormat format = DateTimeFormat
+ .getFormat(getFormatString());
+ date = format.parse(text.getText());
+ long stamp = date.getTime();
+ if (stamp == 0) {
+ // If date parsing fails in firefox the stamp will be 0
+ date = null;
+ }
+
// remove possibly added invalid value indication
removeStyleName(PARSE_ERROR_CLASSNAME);
} catch (final Exception e) {
|