Re: Why can I not extend java.util.Date?

2016-03-24 Thread Thomas Broyer
On Thursday, March 24, 2016 at 2:25:09 PM UTC+1, Stefan Falk wrote: > > My main problem here is that on the server side everything is following > the ISO standard MONDAY = 1, TUESDAY = 2, .. etc and since we only got Date > on he client things can get mixed up. This is why I thought I could >

Re: Why can I not extend java.util.Date?

2016-03-24 Thread Chad Vincent
If you do extend Date, I would not use any 3rd party library calls that take a Date and may use Day of Week, as they might well explode on Sundays. And that has the same problem as a util class, you may forget and make the call somewhere. It's really a lose-lose situation. You're not really s

Re: Why can I not extend java.util.Date?

2016-03-24 Thread Stefan Falk
My main problem here is that on the server side everything is following the ISO standard MONDAY = 1, TUESDAY = 2, .. etc and since we only got Date on he client things can get mixed up. This is why I thought I could wrap/extend Date and just override the getDay() method in order to - have th

Re: Why can I not extend java.util.Date?

2016-03-22 Thread Chad Vincent
1) Dates are very, very, very hard. Calendar idiosyncrasies, time zones, leap seconds... Be 100% sure you need to actually extend Date before messing with it. 2) You are probably better off putting your method (presuming this is the only one) in a custom utility class instead of extending Date

Why can I not extend java.util.Date?

2016-03-20 Thread Stefan Falk
Working with Date is a nightmare.. so beforehand: Any advice regarding work with time and date in GWT are very welcome! Why do my requests silently fail if I do this: public class AwesomeDate extends java.util.Date { public final static int MONDAY = 1; public final static int TUESDAY = 2;