Re: Datebox with day of year format?
I think you're going to want to file an enhancement request here: http://code.google.com/p/google-web-toolkit/issues/entry The Java SimpleDateFormat defines mask character "D" for day in year: http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html The corresponding GWT class (DateTimeFormat) doesn't support that mask character: http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/i18n/client/DateTimeFormat.html Incidentally, there's already an open enhancement request for a related feature -- adding ISO 8601 support to the DateTimeFormat class: http://code.google.com/p/google-web-toolkit/issues/detail?id=4009 On May 4, 9:43 am, azuniga wrote: > The DateTimeFormat doesn't seem to support day of year format for the > day, and I want to know if anyone has had any experience finding a > work around. I'm trying to get my DateBox.DefaultFormat to be -DDD > HH:MM:SS, but so far I can't find support for day of year, 1 - 365. -- 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-toolkit@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.
Datebox with day of year format?
The DateTimeFormat doesn't seem to support day of year format for the day, and I want to know if anyone has had any experience finding a work around. I'm trying to get my DateBox.DefaultFormat to be -DDD HH:MM:SS, but so far I can't find support for day of year, 1 - 365. -- 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-toolkit@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: Day of year?
I actually just came across some great code that NOAA uses for sunrise/ sunset/other ephemeris calculations here: http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html they give their source as "Astronomical Algorithms" by Jean Meeus. They have this js routine: // ***/ //* Name:calcDayOfYear */ //* Type:Function */ //* Purpose: Finds numerical day-of-year from mn, day and lp year info */ //* Arguments: */ //* month: January = 1*/ //* day : 1 - 31 */ //* lpyr : 1 if leap year, 0 if not */ //* Return value: */ //* The numerical day of year */ // ***/ function calcDayOfYear(mn, dy, lpyr) { var k = (lpyr ? 1 : 2); var doy = Math.floor((275 * mn)/9) - k * Math.floor((mn + 9)/12) + dy -30; return doy; } I haven't tested it, but it's what they use for all their online calculators, so take that for what it's worth. On Nov 16, 11:46 am, wytten wrote: > Using GWT 1.5.3 it is not immediately obvious to how to convert a > java.util.Date into a Julian date (i.e, compute day of year). Is > there some way to do this without rolling your own? 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=.
Re: Day of year?
Try http://code.google.com/p/gwtx/ it has support for java.text.* -- it may work for what you want to do. It does not emulate java.sql.Date, but using the SimpleDateFormat, you should be able to provide a proper conversion I think. Regards, Davis On Tue, Nov 17, 2009 at 5:18 PM, Yozons Support on Gmail wrote: > Unfortunately, GWT's DateTimeFormat doesn't support the Java implemention's > 'D' format specifier of SimpleDateTimeFormat. Your server could do the calc > for you perhaps?? > > > > -- > 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=. > -- Zeno Consulting, Inc. home: http://www.zenoconsulting.biz blog: http://zenoconsulting.wikidot.com p: 248.894.4922 f: 313.884.2977 -- 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=.
Re: Day of year?
Unfortunately, GWT's DateTimeFormat doesn't support the Java implemention's 'D' format specifier of SimpleDateTimeFormat. Your server could do the calc for you perhaps?? -- 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=.
Day of year?
Using GWT 1.5.3 it is not immediately obvious to how to convert a java.util.Date into a Julian date (i.e, compute day of year). Is there some way to do this without rolling your own? 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=.