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