Sha256: 16fadcaa88e5762823905b5ae8a1717a1b2804840cdffe0386380c7436ddcc8a

Contents?: true

Size: 806 Bytes

Versions: 19

Compression:

Stored size: 806 Bytes

Contents

var moment = require("./../moment.js");

var UNIT = 'date';

var NOW = Date.now();
var DIFF = -1 * 24 * 60 * 60 * 1e3

var THIS = moment(NOW);
var INPUT = moment(NOW + DIFF);

// For isBetween
var FROM = moment(NOW + DIFF);
var TO = moment(NOW + 2 * DIFF);

function createTest(method) {
    return {
        fn: function() { return method.call(THIS, INPUT, UNIT); },
        async: false
    };
}

var tests = {};
tests.isAfter = createTest(THIS.isAfter);
tests.isBefore = createTest(THIS.isBefore);
tests.isSame = createTest(THIS.isSame);
tests.isSameOrAfter = createTest(THIS.isSameOrAfter);
tests.isSameOrBefore = createTest(THIS.isSameOrBefore);
tests.isBetween = createTest(function () { return THIS.isBetween(FROM, TO, UNIT); });

module.exports = {
    name: 'compare ' + UNIT,
    tests: tests
};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/benchmarks/compare.js
card-mod-date-0.15.0 vendor/moment/benchmarks/compare.js
card-mod-date-0.14.2 vendor/moment/benchmarks/compare.js
card-mod-date-0.14.1 vendor/moment/benchmarks/compare.js
card-mod-date-0.14.0 vendor/moment/benchmarks/compare.js
card-mod-date-0.13.4 vendor/moment/benchmarks/compare.js
card-mod-date-0.13.3 vendor/moment/benchmarks/compare.js
card-mod-date-0.13.2 vendor/moment/benchmarks/compare.js
card-mod-date-0.13.1 vendor/moment/benchmarks/compare.js
card-mod-date-0.13.0 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.7 vendor/moment/benchmarks/compare.js
card-mod-date-0.12.0 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.6 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.5 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.4 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.3 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.2 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.1 vendor/moment/benchmarks/compare.js
card-mod-date-0.11.0 vendor/moment/benchmarks/compare.js