Sha256: 59886d314503d3b445111d2028b60e830ebc14af8f62acfd26506dca91c21f6f
Contents?: true
Size: 667 Bytes
Versions: 19
Compression:
Stored size: 667 Bytes
Contents
import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; import { addRegexToken, match1 } from '../parse/regex'; import { addParseToken } from '../parse/token'; import { MONTH } from './constants'; import toInt from '../utils/to-int'; // FORMATTING addFormatToken('Q', 0, 0, 'quarter'); // ALIASES addUnitAlias('quarter', 'Q'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS export function getSetQuarter (input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); }
Version data entries
19 entries across 19 versions & 4 rubygems