PATH:
usr
/
local
/
lib
/
node_modules
/
knex-migrator
/
node_modules
/
moment
/
src
/
lib
/
moment
import { normalizeUnits, normalizeObjectUnits } from '../units/aliases'; import { getPrioritizedUnits } from '../units/priorities'; import { hooks } from '../utils/hooks'; import isFunction from '../utils/is-function'; import { daysInMonth } from '../units/month'; import { isLeapYear } from '../units/year'; export function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { set(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } export function get (mom, unit) { return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } export function set (mom, unit, value) { if (mom.isValid() && !isNaN(value)) { if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); } else { mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } } // MOMENTS export function stringGet (units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } export function stringSet (units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units); for (var i = 0; i < prioritized.length; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; }
[-] valid.js
[edit]
[+]
..
[-] start-end-of.js
[edit]
[-] now.js
[edit]
[-] to.js
[edit]
[-] min-max.js
[edit]
[-] constructor.js
[edit]
[-] to-type.js
[edit]
[-] diff.js
[edit]
[-] get-set.js
[edit]
[-] creation-data.js
[edit]
[-] compare.js
[edit]
[-] format.js
[edit]
[-] prototype.js
[edit]
[-] add-subtract.js
[edit]
[-] calendar.js
[edit]
[-] locale.js
[edit]
[-] moment.js
[edit]
[-] from.js
[edit]
[-] clone.js
[edit]