3 describe('egDate', function(){
4 beforeEach(module('egCoreMod'));
6 beforeEach(function () {
9 // "2 days" may be 47, 48, or 49 hours depending on the
10 // proximity to and direction of a time change event.
11 // This does not take leap seconds into account.
12 toBe2DaysOfSeconds: function () {
14 compare : function(actual) {
15 var hours_47 = 169200;
16 var hours_48 = 172800;
17 var hours_49 = 176400;
27 message: "Expected " + actual + " to be " +
28 hours_47 + ", " + hours_48 + ", or " + hours_49
36 it('should parse a simple interval', inject(function(egDate) {
37 expect(egDate.intervalToSeconds('2 days')).toBe2DaysOfSeconds();
40 it('should parse a combined interval', inject(function(egDate) {
41 expect(egDate.intervalToSeconds('1 min 2 seconds')).toBe(62);
44 it('should parse a time interval', inject(function(egDate) {
45 expect(egDate.intervalToSeconds('02:00:23')).toBe(7223);