Re: Bug in DateTimeFormat?

2010-03-25 Thread djd
Looks like I have this problem again...

EEE, dd MMM yy HH:mm:ss Z
Wed, 24 Mar 10 23:57:47 +

I'm not sure why, but all invalid dates are between 22:00 and 23:59.
Could be an hour issue?

On Mar 3, 9:58 pm, Sorinel C scristescu...@hotmail.com wrote:
 Is this browser case? that means is it happens with a certain browser
 (IE). Which version 6, 7, or  8 ?
 Did you try it with Firefox or Chrome?

 Why do you need to do parsing of the date on the client side; cannot
 you do it on server side (using the full Calendar and TimeZone
 classes) ???
 Cheers!

 I have a posting here, but I don't think it's exactly what you are
 asking for?

 http://ui-programming.blogspot.com/2010/02/gwt-date-and-timestamp-rpc...

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Bug in DateTimeFormat?

2010-03-03 Thread djd
Hello guys, I may have found a bug while trying to parse a String with
a given DateTimeFormat.

The date format that I expect is
EEE MMM dd HH:mm:ss Z .

This should parse dates like:
Tue Apr 07 22:52:51 + 2009

However, the parse fails for some dates, like:
Tue Mar 02 23:20:07 + 2010

For 99% of failures, it happens for 03/02/2010, between 22:00 - 23:59.
I also have 1 failure for 01/24/2010.
Am I doing something wrong there? I have looked over the code/pattern
in the last 2 hours and could not find anything misspelled.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Bug in DateTimeFormat?

2010-03-03 Thread djd
It looks like IE8 is unable to parse any date at all ! They are
incredible :(

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Bug in DateTimeFormat?

2010-03-03 Thread Sorinel C
Is this browser case? that means is it happens with a certain browser
(IE). Which version 6, 7, or  8 ?
Did you try it with Firefox or Chrome?

Why do you need to do parsing of the date on the client side; cannot
you do it on server side (using the full Calendar and TimeZone
classes) ???
Cheers!

I have a posting here, but I don't think it's exactly what you are
asking for?

http://ui-programming.blogspot.com/2010/02/gwt-date-and-timestamp-rpc.html

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Bug in DateTimeFormat GWT

2009-12-30 Thread Chris Ramsdale
What you are describing sounds pretty straight forward, but would you mind
replying with a specific code snippet so that we can try reproducing the
issue?

- Chris

On Tue, Dec 29, 2009 at 1:43 PM, Chris christopher.burr...@gmail.comwrote:

 Clearly no ideas... Can i raise this somewhere?

 On Dec 15, 4:29 pm, Chris christopher.burr...@gmail.com wrote:
  Hi All
 
  Although the DateTimeFormat seems to work fine with most browsers,
  using the hosted/development mode, it does not handle Eras properly.
 
  Using GWT 1.x or GWT 2.0 I get the same behaviour:
 
  In Firefox, normally compiled etc. shows BC fine.
  In Development in Firefox, shows AD instead of BC
 
  Any ideas if this is just me overlooking something? or a real bug?
  Cheers
  Chris

 --

 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Re: Bug in DateTimeFormat GWT

2009-12-29 Thread Chris
Clearly no ideas... Can i raise this somewhere?

On Dec 15, 4:29 pm, Chris christopher.burr...@gmail.com wrote:
 Hi All

 Although the DateTimeFormat seems to work fine with most browsers,
 using the hosted/development mode, it does not handle Eras properly.

 Using GWT 1.x or GWT 2.0 I get the same behaviour:

 In Firefox, normally compiled etc. shows BC fine.
 In Development in Firefox, shows AD instead of BC

 Any ideas if this is just me overlooking something? or a real bug?
 Cheers
 Chris

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Bug in DateTimeFormat GWT

2009-12-15 Thread Chris
Hi All

Although the DateTimeFormat seems to work fine with most browsers,
using the hosted/development mode, it does not handle Eras properly.

Using GWT 1.x or GWT 2.0 I get the same behaviour:

In Firefox, normally compiled etc. shows BC fine.
In Development in Firefox, shows AD instead of BC

Any ideas if this is just me overlooking something? or a real bug?
Cheers
Chris

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




[gwt-contrib] [google-web-toolkit commit] r5257 - Fixes a bug where DateTimeFormat would accept 0 as a valid month or day. Also

2009-04-17 Thread codesite-noreply

Author: a...@google.com
Date: Fri Apr 17 14:54:39 2009
New Revision: 5257

Modified:
trunk/user/src/com/google/gwt/i18n/client/DateTimeFormat.java
trunk/user/test/com/google/gwt/i18n/client/DateTimeParse_en_Test.java

Log:
Fixes a bug where DateTimeFormat would accept 0 as a valid month or day.  
Also
adds a test to demonstrate the fix.

patch by: shanjianli
review by: ajr


Modified: trunk/user/src/com/google/gwt/i18n/client/DateTimeFormat.java
==
--- trunk/user/src/com/google/gwt/i18n/client/DateTimeFormat.java   
(original)
+++ trunk/user/src/com/google/gwt/i18n/client/DateTimeFormat.java   Fri Apr 
 
17 14:54:39 2009
@@ -1705,6 +1705,9 @@
case 'y': // 'y' - YEAR
  return subParseYear(text, pos, start, value, part, cal);
case 'd': // 'd' - DATE
+if (value = 0) {
+  return false;
+}
  cal.setDayOfMonth(value);
  return true;
case 'S': // 'S' - FRACTIONAL_SECOND
@@ -1823,10 +1826,11 @@
}
cal.setMonth(value);
return true;
-} else {
+} else if (value  0) {
cal.setMonth(value - 1);
return true;
  }
+return false;
}

/**

Modified:  
trunk/user/test/com/google/gwt/i18n/client/DateTimeParse_en_Test.java
==
--- trunk/user/test/com/google/gwt/i18n/client/DateTimeParse_en_Test.java   
 
(original)
+++ trunk/user/test/com/google/gwt/i18n/client/DateTimeParse_en_Test.java   
 
Fri Apr 17 14:54:39 2009
@@ -638,4 +638,25 @@
  assertTrue(date.getDate() == 02);
}

+  public void testInvalidDayAndMonth() {
+DateTimeFormat fmt = DateTimeFormat.getFormat(MM/dd/);
+try {
+  fmt.parseStrict(00/22/1999);
+  fail(Should have thrown an exception on failure to parse);
+} catch (IllegalArgumentException e) {
+  // Success
+}
+try {
+  fmt.parseStrict(01/00/1999);
+  fail(Should have thrown an exception on failure to parse);
+} catch (IllegalArgumentException e) {
+  // Success
+}
+try {
+  fmt.parseStrict(01/22/1999);
+  // success
+} catch (IllegalArgumentException e) {
+  fail(Should succeed to parse);
+}
+  }
  }

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---