|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 |
| -describe('filters', function() { |
| 3 | +ddescribe('filters', function() { |
4 | 4 |
|
5 | 5 | var filter;
|
6 | 6 |
|
@@ -326,6 +326,36 @@ describe('filters', function() {
|
326 | 326 | toEqual('2010-09-03T06:35:08-0530');
|
327 | 327 | });
|
328 | 328 |
|
| 329 | + it('should correctly calculate week number', function () { |
| 330 | + function formatWeek(dateToFormat) { |
| 331 | + return date(new angular.mock.TzDate(+5, dateToFormat + 'T12:00:00.000Z'), 'ww (EEE)'); |
| 332 | + } |
| 333 | + |
| 334 | + expect(formatWeek('2007-01-01')).toEqual('01 (Mon)'); |
| 335 | + expect(formatWeek('2007-12-31')).toEqual('53 (Mon)'); |
| 336 | + |
| 337 | + expect(formatWeek('2008-01-01')).toEqual('01 (Tue)'); |
| 338 | + expect(formatWeek('2008-12-31')).toEqual('53 (Wed)'); |
| 339 | + |
| 340 | + expect(formatWeek('2014-01-01')).toEqual('01 (Wed)'); |
| 341 | + expect(formatWeek('2014-12-31')).toEqual('53 (Wed)'); |
| 342 | + |
| 343 | + expect(formatWeek('2009-01-01')).toEqual('01 (Thu)'); |
| 344 | + expect(formatWeek('2009-12-31')).toEqual('53 (Thu)'); |
| 345 | + |
| 346 | + expect(formatWeek('2010-01-01')).toEqual('00 (Fri)'); |
| 347 | + expect(formatWeek('2010-12-31')).toEqual('52 (Fri)'); |
| 348 | + |
| 349 | + expect(formatWeek('2011-01-01')).toEqual('00 (Sat)'); |
| 350 | + expect(formatWeek('2011-01-02')).toEqual('01 (Sun)'); |
| 351 | + expect(formatWeek('2011-01-03')).toEqual('01 (Mon)'); |
| 352 | + expect(formatWeek('2011-12-31')).toEqual('52 (Sat)'); |
| 353 | + |
| 354 | + expect(formatWeek('2012-01-01')).toEqual('01 (Sun)'); |
| 355 | + expect(formatWeek('2012-01-02')).toEqual('01 (Mon)'); |
| 356 | + expect(formatWeek('2012-12-31')).toEqual('53 (Mon)'); |
| 357 | + }); |
| 358 | + |
329 | 359 | it('should treat single quoted strings as string literals', function() {
|
330 | 360 | expect(date(midnight, "yyyy'de' 'a'x'dd' 'adZ' h=H:m:saZ")).
|
331 | 361 | toEqual('2010de axdd adZ 12=0:5:8AM-0500');
|
|
0 commit comments