%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'; var symbolMap = { '1': '!', '2': '@', '3': '#', '4': '$', '5': '%', '6': '^', '7': '&', '8': '*', '9': '(', '0': ')' }, numberMap = { '!': '1', '@': '2', '#': '3', '$': '4', '%': '5', '^': '6', '&': '7', '*': '8', '(': '9', ')': '0' }; module('preparse and postformat', { setup: function () { moment.locale('symbol', { preparse: function (string) { return string.replace(/[!@#$%\^&*()]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); } }); }, teardown: function () { moment.defineLocale('symbol', null); } }); test('transform', function (assert) { assert.equal(moment.utc('@)!@-)*-@&', 'YYYY-MM-DD').unix(), 1346025600, 'preparse string + format'); assert.equal(moment.utc('@)!@-)*-@&').unix(), 1346025600, 'preparse ISO8601 string'); assert.equal(moment.unix(1346025600).utc().format('YYYY-MM-DD'), '@)!@-)*-@&', 'postformat'); }); test('transform from', function (assert) { var start = moment([2007, 1, 28]); assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '@ minutes', 'postformat should work on moment.fn.from'); assert.equal(moment().add(6, 'd').fromNow(true), '^ days', 'postformat should work on moment.fn.fromNow'); assert.equal(moment.duration(10, 'h').humanize(), '!) hours', 'postformat should work on moment.duration.fn.humanize'); }); test('calendar day', function (assert) { var a = moment().hours(12).minutes(0).seconds(0); assert.equal(moment(a).calendar(), 'Today at !@:)) PM', 'today at the same time'); assert.equal(moment(a).add({m: 25}).calendar(), 'Today at !@:@% PM', 'Now plus 25 min'); assert.equal(moment(a).add({h: 1}).calendar(), 'Today at !:)) PM', 'Now plus 1 hour'); assert.equal(moment(a).add({d: 1}).calendar(), 'Tomorrow at !@:)) PM', 'tomorrow at the same time'); assert.equal(moment(a).subtract({h: 1}).calendar(), 'Today at !!:)) AM', 'Now minus 1 hour'); assert.equal(moment(a).subtract({d: 1}).calendar(), 'Yesterday at !@:)) PM', 'yesterday at the same time'); });