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 () {
13 var actual = this.actual;
14 var hours_47 = 169200;
15 var hours_48 = 172800;
16 var hours_49 = 176400;
18 this.message = function () {
19 return "Expected " + actual + " to be " +
20 hours_47 + ", " + hours_48 + ", or " + hours_49;
32 it('should parse a simple interval', inject(function(egDate) {
33 expect(egDate.intervalToSeconds('2 days')).toBe2DaysOfSeconds();
36 it('should parse a combined interval', inject(function(egDate) {
37 expect(egDate.intervalToSeconds('1 min 2 seconds')).toBe(62);
40 it('should parse a time interval', inject(function(egDate) {
41 expect(egDate.intervalToSeconds('02:00:23')).toBe(7223);