Re: Get today's date, and the first day of this week's date?

2010-06-10 Thread Nicholas
To answer #6: I asked the GWT team about this during the fireside chat at I/O this year. They appeared to be caught off guard by the question but eventually came out and said that they have no plans on resolving this issue. I kind of got the feeling that this was the first time that it came up to

Re: Get today's date, and the first day of this week's date?

2010-06-10 Thread Lothar Kimmeringer
Charles Keepax schrieb: > As for performing operations on Dates such as adding days I usually > use the getTime method (this returns the Date as a long representing > the number of milliseconds that have passed since January 1, 1970, > 00:00:00 GMT) and operate on the dates as a long. So for examp

Re: Get today's date, and the first day of this week's date?

2010-06-09 Thread Charles Keepax
Probably the best class to implement that functionality would be DateTimeFormat ( http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/i18n/client/DateTimeFormat.html ) which is very similar to the Java DateFormat class. So for example: Date today = new Date(); DateTimeFormat d

Re: Get today's date, and the first day of this week's date?

2010-06-09 Thread Charles Keepax
You could return a string for what day of the week it is from the DateTimeFormat (using "E"), then do a large if statement to return the first day of the week. Charles Keepax -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this

Re: Get today's date, and the first day of this week's date?

2010-06-09 Thread Lothar Kimmeringer
spierce7 schrieb: > Lothar, your code works (at least for the current date) : It should work for every date, just instantiate Date with one of the non-default constructors. > However, I can't find a way to get the first day of the week for any > given date. For instance, lets say I wanted to fin

Re: Get today's date, and the first day of this week's date?

2010-06-08 Thread spierce7
Guys, thank you so much for your replies! I've got my program doing what I needed it to :-) Thank you very much! Lothar, your code works (at least for the current date) : DateTimeConstants constants = LocaleInfo.getCurrentLocale().getDateTimeConstants(); int firstDay = Integer.parseInt(constants.f

Re: Get today's date, and the first day of this week's date?

2010-06-08 Thread Lothar Kimmeringer
spierce7 schrieb: > 1. Get today's date. Date today = new Date(); > 2. Using the current date, get the date of the first day of the week > (Sunday), and I think I might need to know how to get the end date > also. So you're not going to create an i8n-aware application? Sunday isn't the first da

Re: Get today's date, and the first day of this week's date?

2010-06-08 Thread fmod
> Hey guys, I just found out that the Java Calendar class isn't > compatible with GWT (Assumed it was since Date was). I'm a Java newb > and spent a few hours figuring out how to do what I wanted to do with > the Calendar class, and I'm clueless how to do this with GWT, so any > help would be appre

Get today's date, and the first day of this week's date?

2010-06-08 Thread spierce7
Hey guys, I just found out that the Java Calendar class isn't compatible with GWT (Assumed it was since Date was). I'm a Java newb and spent a few hours figuring out how to do what I wanted to do with the Calendar class, and I'm clueless how to do this with GWT, so any help would be appreciated. 1