Re: Get week number from a Date object

2010-08-06 Thread Glimpse
Thank you.

Maybe I made a mistake when coding it with your algorithm, but it
seems that it does not always work.
As a reference, I'm using this website (in french):
http://www.calendrier-365.fr/calendrier-2010.html

And I found this script to work well: 
http://syn.ac/tech/19/get-the-weeknumber-with-javascript/
It is easy to transform into Java/GWT (but with all the deprecation
warnings around the Date object).

On 5 août, 23:13, ctasada ctas...@gmail.com wrote:
 AFAIK the only way is calculating it yourself

         public static int calendarWeekIso(final Date inputDate) {

                 int thursdayDay = 4 + firstDayOfWeek;

                 Date thisThursday = new Date(inputDate.getYear(),
 inputDate.getMonth(),
                                 inputDate.getDate() - weekday(inputDate) + 
 thursdayDay);

                 Date firstThursdayOfYear = new Date(thisThursday.getYear(), 
 0, 1);

                 while (weekday(firstThursdayOfYear) != thursdayDay) {
                         
 firstThursdayOfYear.setDate(firstThursdayOfYear.getDate() + 1);
                 }

                 Date firstMondayOfYear = new 
 Date(firstThursdayOfYear.getYear(), 0,
                                 firstThursdayOfYear.getDate() - 3);

                 Long cw = (thisThursday.getTime() - 
 firstMondayOfYear.getTime())
                                 / ONE_DAY / DAYS_IN_A_WEEK + 1;

                 return cw.intValue();
         }

 On 5 ago, 17:15, Glimpse frederic.bonj...@gmail.com wrote:



  Hello all,

  I'd like to know if there is an easy way to get the week number from a
  Date object. In pure Java, the Calendar class does the trick via a
  call to get(Calendar.WEEK_OF_YEAR); but the Calendar class is not
  available in GWT.

  Any idea?

-- 
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.



Get week number from a Date object

2010-08-05 Thread Glimpse
Hello all,

I'd like to know if there is an easy way to get the week number from a
Date object. In pure Java, the Calendar class does the trick via a
call to get(Calendar.WEEK_OF_YEAR); but the Calendar class is not
available in GWT.

Any idea?

-- 
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: How to find correctly the client's locale?

2010-07-19 Thread Glimpse
I've renamed my index.html to index.jsp and I've added the
following line in the head/ section:

meta name=gwt:property content=locale=%=request.getLocale()%

My application now uses the preferred language defined in the
browser's settings.
This works fine!


On 19 juil, 10:24, Sorinel C scristescu...@hotmail.com wrote:
 I have in my module .gwt.xml file definition the following lines:

         inherits name=com.google.gwt.core.Core /
         inherits name=com.google.gwt.user.User /
         inherits name=com.google.gwt.i18n.I18N /
         inherits name=com.google.gwt.i18n.CldrLocales /
         inherits
 name=com.google.gwt.user.theme.standard.StandardResources /

 So, maybe something else is wrong, but I don't catch it :(

 Thanks!

 PS: some other GWT tricks you can find 
 here:http://ui-programming.blogspot.com/
 :-))

-- 
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: GWT Hosted Mode crashing after Snow Leopard 10.6.2 Update

2009-11-12 Thread Glimpse
Thank you for the JAR!
But on my system, it doesn't work: Hosted mode started to display my
application, but crashed one second later.

Any idea?

On 12 nov, 12:35, Daniel Kurka kurka.dan...@googlemail.com wrote:
 I found a very UGLY solution to my problem (which enables me to continue
 working).

 I replaced in LowLevelSaf.java public static native void gcUnprotect(int,
 int); to public static void gcUnprotect(int, int) {}

 causing the invalid access

 This is not a real fix, just a very nasty workaround

 If you run into the same problem you can download a fixed gwt-dev.jar from
 here:

 http://www.daniel-kurka.de/gwt-dev-1.7.1-mac-sf-4.0.4-fix.jar

--

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=.