Skip to content

Commit

Permalink
Merge pull request mootools#1248 from SergioCrisostomo/spec-fix-DateU…
Browse files Browse the repository at this point in the history
…TC-IE

Use Date.UTC() instead of Browser.ie
  • Loading branch information
arian committed Apr 25, 2014
2 parents ec4cb4d + 39e81bf commit 7239538
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Specs/Types/Date.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ describe('Date', function(){

it('should return the time zone of a Date instance', function(){
var d = new Date(Date.UTC(2000, 0, 1, 1, 1, 1));
if (global['Browser'] && Browser.ie) expect(d.get('timezone')).toEqual(new Date(Date.UTC()).get('timezone'));
if (Date.UTC()) expect(d.get('timezone')).toEqual(new Date(Date.UTC()).get('timezone'));
else expect(d.get('timezone')).toEqual('GMT');
});

Expand Down Expand Up @@ -459,7 +459,7 @@ describe('Date', function(){
expect(d.format('%Y')).toEqual('1997');
});
it('should format the timezone', function(){
if (global['Browser'] && Browser.ie) expect(d.format('%Z')).toEqual(new Date(Date.UTC()).get('timezone'));
if (Date.UTC()) expect(d.format('%Z')).toEqual(new Date(Date.UTC()).get('timezone'));
else expect(d.format('%Z')).toEqual('GMT');
});
it('should only replace the % when it is followd by a single a-z', function(){
Expand All @@ -484,7 +484,7 @@ describe('Date', function(){

it('should support the rfc822 shortcut', function(){
expect(d.format('rfc822')).toEqual(d.format('%a') + ', ' + d.format('%d') + ' ' + d.format('%b') + ' ' + d.format('%Y') + ' ' + d.format('%H') + ':' + d.format('%M') + ':' + d.format('%S') + ' ' + d.format('%Z'));
if (global['Browser'] && Browser.ie) expect(d.format('rfc822')).toEqual('Thu, 20 Nov 1997 01:02:03 ' + new Date(Date.UTC()).get('timezone'));
if (Date.UTC()) expect(d.format('rfc822')).toEqual('Thu, 20 Nov 1997 01:02:03 ' + new Date(Date.UTC()).get('timezone'));
else expect(d.format('rfc822')).toEqual('Thu, 20 Nov 1997 01:02:03 GMT');
});

Expand Down

0 comments on commit 7239538

Please sign in to comment.