Shouldn't something like this be in the framework?
qx.locale.Date.isDST() or something?

T.

On 10/06/2010 06:46 PM, Mustafa Sak wrote:
> Thx Joffrey,
> 
> it is a matter of DST "day light saving time". So I found a nice function to
> get if we are in sommer (true) or
>  winter (false) time. I want to share it with the list:
> 
> Date.prototype.getDST = function() {
>                       var now_local = this;
>                       var jan_local = new Date(now_local.getFullYear(), 0,
> 1, 0, 0, 0, 0, 0);
>                       var jun_local = new Date(now_local.getFullYear(), 5,
> 1, 0, 0, 0, 0, 0);
>                       var now_utc = new Date.UTC(now_local.getFullYear(),
> now_local.getMonth(), now_local.getDate(), now_local.getHours(),
> now_local.getMinutes(), now_local.getSeconds(),
> now_local.getMilliseconds());
>                       var jan_utc = new Date.UTC(jan_local.getFullYear(),
> jan_local.getMonth(), jan_local.getDate(), jan_local.getHours(),
> jan_local.getMinutes(), jan_local.getSeconds(),
> jun_local.getMilliseconds());
>                       var jun_utc = new Date.UTC(jun_local.getFullYear(),
> jun_local.getMonth(), jun_local.getDate(), jun_local.getHours(),
> jun_local.getMinutes(), jun_local.getSeconds(),
> jan_local.getMilliseconds());
>                       var now_diff = Math.round((now_utc -
> now_local.getTime()) / (1000 * 3600));
>                       var jan_diff = Math.round((jan_utc -
> jan_local.getTime()) / (1000 * 3600));
>                       var jun_diff = Math.round((jun_utc -
> jun_local.getTime()) / (1000 * 3600));
>                       return jan_diff != jun_diff && now_diff ==
> Math.max(jan_diff, jun_diff);
>               };
> 
> Taken from
> http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript
> 
> Regards Sak
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Joffrey Fuhrer - NOVLOG [mailto:[email protected]] 
> Gesendet: Mittwoch, 6. Oktober 2010 18:11
> An: qooxdoo Development
> Betreff: Re: [qooxdoo-devel] Does javascript has a bug on Date object
> 
> Hi Mustafa,
> 
> It sure looks like a DST issue. Switching back to winter time happens on 
> the last Sunday of October!
> 

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to