%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11584/cwd/html/ppaobm/vendor/bower-asset/moment/src/test/moment/ |
Upload File : |
import { module, test } from '../qunit'; import moment from '../../moment'; module('duration from moments'); test('pure year diff', function (assert) { var m1 = moment('2012-01-01T00:00:00.000Z'), m2 = moment('2013-01-01T00:00:00.000Z'); assert.equal(moment.duration({from: m1, to: m2}).as('years'), 1, 'year moment difference'); assert.equal(moment.duration({from: m2, to: m1}).as('years'), -1, 'negative year moment difference'); }); test('month and day diff', function (assert) { var m1 = moment('2012-01-15T00:00:00.000Z'), m2 = moment('2012-02-17T00:00:00.000Z'), d = moment.duration({from: m1, to: m2}); assert.equal(d.get('days'), 2); assert.equal(d.get('months'), 1); }); test('day diff, separate months', function (assert) { var m1 = moment('2012-01-15T00:00:00.000Z'), m2 = moment('2012-02-13T00:00:00.000Z'), d = moment.duration({from: m1, to: m2}); assert.equal(d.as('days'), 29); }); test('hour diff', function (assert) { var m1 = moment('2012-01-15T17:00:00.000Z'), m2 = moment('2012-01-16T03:00:00.000Z'), d = moment.duration({from: m1, to: m2}); assert.equal(d.as('hours'), 10); }); test('minute diff', function (assert) { var m1 = moment('2012-01-15T17:45:00.000Z'), m2 = moment('2012-01-16T03:15:00.000Z'), d = moment.duration({from: m1, to: m2}); assert.equal(d.as('hours'), 9.5); });