Sha256: c5a098231e38b7e2d4661ffe539a9600549647ef8daf25126a39ea7498560007

Contents?: true

Size: 590 Bytes

Versions: 19

Compression:

Stored size: 590 Bytes

Contents

import { addFormatToken } from '../format/format';
import { addRegexToken, matchTimestamp, matchSigned } from '../parse/regex';
import { addParseToken } from '../parse/token';
import toInt from '../utils/to-int';

// FORMATTING

addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf');

// PARSING

addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
    config._d = new Date(parseFloat(input) * 1000);
});
addParseToken('x', function (input, array, config) {
    config._d = new Date(toInt(input));
});

Version data entries

19 entries across 19 versions & 1 rubygems

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