Files
fullcalendar/tests/lib/jasmine-ext.js
T
2014-09-04 14:37:09 +01:00

27 lines
557 B
JavaScript

beforeEach(function() {
jasmine.addMatchers({
toEqualMoment: function() {
return {
compare: function(actual, expected) {
return {
pass: $.fullCalendar.moment.parseZone(actual).format() ===
$.fullCalendar.moment.parseZone(expected).format()
};
}
};
},
toEqualNow: function() {
return {
compare: function(actual) {
return {
pass: Math.abs(
$.fullCalendar.moment.parseZone(actual) -
new Date()
) < 1000 // within a second of current datetime
};
}
};
}
});
});