mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 13:25:40 +08:00
Fixed filter date test - remove dependency on machine timezone
It would be better to separate the time-zone logic to a separate unit and test just this logic. This logic is simply convert minutes to HH:MM, the source of time-zone is from date object...
This commit is contained in:
@@ -88,7 +88,11 @@ describe('filter', function(){
|
||||
|
||||
describe('date', function(){
|
||||
var date = angular.String.toDate('2010-10-13T14:45:23Z');
|
||||
|
||||
//butt-ugly hack: force the date to be 2pm PDT for locale testing
|
||||
date.setHours(14);
|
||||
date.getTimezoneOffset = function() { return 7 * 60; };
|
||||
|
||||
|
||||
it('should do basic filter', function() {
|
||||
expect(filter.date(date)).toEqual(date.toLocaleDateString());
|
||||
|
||||
Reference in New Issue
Block a user