|
@@ -2,42 +2,42 @@
|
|
|
describe('ambiguously-zoned moment', function() {
|
|
describe('ambiguously-zoned moment', function() {
|
|
|
|
|
|
|
|
it('has a false hasZone', function() {
|
|
it('has a false hasZone', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('has a true hasTime', function() {
|
|
it('has a true hasTime', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('has a zero zone', function() {
|
|
it('has a zero zone', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.utcOffset()).toBe(0)
|
|
expect(mom.utcOffset()).toBe(0)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats without a zone part', function() {
|
|
it('formats without a zone part', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.format()).toBe('2014-06-08T10:00:00')
|
|
expect(mom.format()).toBe('2014-06-08T10:00:00')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats via toISOString without a zone part', function() {
|
|
it('formats via toISOString without a zone part', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
|
|
expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats via toISOString for locales with non-trivial formatting', function() {
|
|
it('formats via toISOString for locales with non-trivial formatting', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
|
|
|
expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
|
|
expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats ISO8601 via format() for locales with non-trivial formatting', function() {
|
|
it('formats ISO8601 via format() for locales with non-trivial formatting', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
|
|
|
expect(mom.format()).toBe('2014-06-08T10:00:00')
|
|
expect(mom.format()).toBe('2014-06-08T10:00:00')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('is correctly cloned', function() {
|
|
it('is correctly cloned', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
var clone = mom.clone()
|
|
var clone = mom.clone()
|
|
|
expect(clone.hasZone()).toBe(false)
|
|
expect(clone.hasZone()).toBe(false)
|
|
|
expect(clone.format()).toBe('2014-06-08T10:00:00')
|
|
expect(clone.format()).toBe('2014-06-08T10:00:00')
|
|
@@ -47,7 +47,7 @@ describe('ambiguously-zoned moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a zone via utc', function() {
|
|
it('can be given a zone via utc', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
expect(mom.utcOffset()).toBe(0)
|
|
expect(mom.utcOffset()).toBe(0)
|
|
@@ -58,7 +58,7 @@ describe('ambiguously-zoned moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a zone via local', function() {
|
|
it('can be given a zone via local', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
var equivDate = new Date(Date.UTC(2014, 5, 8, 10, 0, 0))
|
|
var equivDate = new Date(Date.UTC(2014, 5, 8, 10, 0, 0))
|
|
|
expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ])
|
|
expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ])
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
@@ -72,7 +72,7 @@ describe('ambiguously-zoned moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a zone via zone', function() {
|
|
it('can be given a zone via zone', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08T10:00:00')
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
expect(mom.utcOffset()).toBe(0)
|
|
expect(mom.utcOffset()).toBe(0)
|
|
@@ -87,33 +87,33 @@ describe('ambiguously-zoned moment', function() {
|
|
|
describe('ambiguously-timed moment', function() {
|
|
describe('ambiguously-timed moment', function() {
|
|
|
|
|
|
|
|
it('has a false hasTime', function() {
|
|
it('has a false hasTime', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.hasTime()).toBe(false)
|
|
expect(mom.hasTime()).toBe(false)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('has a false hasZone', function() {
|
|
it('has a false hasZone', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('has a zero time', function() {
|
|
it('has a zero time', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
var time = mom.time()
|
|
var time = mom.time()
|
|
|
expect(+time).toBe(0)
|
|
expect(+time).toBe(0)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats without a zone part', function() {
|
|
it('formats without a zone part', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.format()).toBe('2014-06-08')
|
|
expect(mom.format()).toBe('2014-06-08')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('formats via toISOString without a time part', function() {
|
|
it('formats via toISOString without a time part', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.toISOString()).toBe('2014-06-08')
|
|
expect(mom.toISOString()).toBe('2014-06-08')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('is correctly cloned', function() {
|
|
it('is correctly cloned', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
var clone = mom.clone()
|
|
var clone = mom.clone()
|
|
|
expect(clone.hasTime()).toBe(false)
|
|
expect(clone.hasTime()).toBe(false)
|
|
|
expect(clone.format()).toBe('2014-06-08')
|
|
expect(clone.format()).toBe('2014-06-08')
|
|
@@ -123,7 +123,7 @@ describe('ambiguously-timed moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a time', function() {
|
|
it('can be given a time', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.hasTime()).toBe(false)
|
|
expect(mom.hasTime()).toBe(false)
|
|
|
var time = moment.duration({ hours: 1, minutes: 25 })
|
|
var time = moment.duration({ hours: 1, minutes: 25 })
|
|
|
mom.time(time)
|
|
mom.time(time)
|
|
@@ -132,7 +132,7 @@ describe('ambiguously-timed moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a time and zone via utc', function() {
|
|
it('can be given a time and zone via utc', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.hasTime()).toBe(false)
|
|
expect(mom.hasTime()).toBe(false)
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
expect(mom.utcOffset()).toBe(0)
|
|
expect(mom.utcOffset()).toBe(0)
|
|
@@ -143,7 +143,7 @@ describe('ambiguously-timed moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a time and zone via local', function() {
|
|
it('can be given a time and zone via local', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
var equivDate = new Date(2014, 5, 8, 10, 0, 0)
|
|
var equivDate = new Date(2014, 5, 8, 10, 0, 0)
|
|
|
expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ])
|
|
expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ])
|
|
|
expect(mom.hasTime()).toBe(false)
|
|
expect(mom.hasTime()).toBe(false)
|
|
@@ -157,7 +157,7 @@ describe('ambiguously-timed moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be given a time and zone via zone', function() {
|
|
it('can be given a time and zone via zone', function() {
|
|
|
- var mom = $.fullCalendar.moment.parseZone('2014-06-08')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.parseZone('2014-06-08')
|
|
|
expect(mom.hasTime()).toBe(false)
|
|
expect(mom.hasTime()).toBe(false)
|
|
|
expect(mom.hasZone()).toBe(false)
|
|
expect(mom.hasZone()).toBe(false)
|
|
|
expect(mom.utcOffset()).toBe(0)
|
|
expect(mom.utcOffset()).toBe(0)
|
|
@@ -172,7 +172,7 @@ describe('ambiguously-timed moment', function() {
|
|
|
describe('unambiguous moment', function() {
|
|
describe('unambiguous moment', function() {
|
|
|
|
|
|
|
|
it('can be made ambiguously-zoned via stripZone', function() {
|
|
it('can be made ambiguously-zoned via stripZone', function() {
|
|
|
- var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.utc('2014-06-08T10:00:00-0000')
|
|
|
expect(mom.hasZone()).toBe(true)
|
|
expect(mom.hasZone()).toBe(true)
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
|
mom.stripZone()
|
|
mom.stripZone()
|
|
@@ -182,7 +182,7 @@ describe('unambiguous moment', function() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('can be made ambigously-timed via stripTime', function() {
|
|
it('can be made ambigously-timed via stripTime', function() {
|
|
|
- var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000')
|
|
|
|
|
|
|
+ var mom = FullCalendar.moment.utc('2014-06-08T10:00:00-0000')
|
|
|
expect(mom.hasTime()).toBe(true)
|
|
expect(mom.hasTime()).toBe(true)
|
|
|
expect(mom.hasZone()).toBe(true)
|
|
expect(mom.hasZone()).toBe(true)
|
|
|
mom.stripTime()
|
|
mom.stripTime()
|