1 import { Moment } from './constructor';
3 var proto = Moment.prototype;
5 import { add, subtract } from './add-subtract';
6 import { calendar } from './calendar';
7 import { clone } from './clone';
8 import { isBefore, isBetween, isSame, isAfter, isSameOrAfter, isSameOrBefore } from './compare';
9 import { diff } from './diff';
10 import { format, toString, toISOString } from './format';
11 import { from, fromNow } from './from';
12 import { to, toNow } from './to';
13 import { getSet } from './get-set';
14 import { locale, localeData, lang } from './locale';
15 import { prototypeMin, prototypeMax } from './min-max';
16 import { startOf, endOf } from './start-end-of';
17 import { valueOf, toDate, toArray, toObject, toJSON, unix } from './to-type';
18 import { isValid, parsingFlags, invalidAt } from './valid';
19 import { creationData } from './creation-data';
22 proto.calendar = calendar;
26 proto.format = format;
28 proto.fromNow = fromNow;
32 proto.invalidAt = invalidAt;
33 proto.isAfter = isAfter;
34 proto.isBefore = isBefore;
35 proto.isBetween = isBetween;
36 proto.isSame = isSame;
37 proto.isSameOrAfter = isSameOrAfter;
38 proto.isSameOrBefore = isSameOrBefore;
39 proto.isValid = isValid;
41 proto.locale = locale;
42 proto.localeData = localeData;
43 proto.max = prototypeMax;
44 proto.min = prototypeMin;
45 proto.parsingFlags = parsingFlags;
47 proto.startOf = startOf;
48 proto.subtract = subtract;
49 proto.toArray = toArray;
50 proto.toObject = toObject;
51 proto.toDate = toDate;
52 proto.toISOString = toISOString;
53 proto.toJSON = toJSON;
54 proto.toString = toString;
56 proto.valueOf = valueOf;
57 proto.creationData = creationData;
60 import { getSetYear, getIsLeapYear } from '../units/year';
61 proto.year = getSetYear;
62 proto.isLeapYear = getIsLeapYear;
65 import { getSetWeekYear, getSetISOWeekYear, getWeeksInYear, getISOWeeksInYear } from '../units/week-year';
66 proto.weekYear = getSetWeekYear;
67 proto.isoWeekYear = getSetISOWeekYear;
70 import { getSetQuarter } from '../units/quarter';
71 proto.quarter = proto.quarters = getSetQuarter;
74 import { getSetMonth, getDaysInMonth } from '../units/month';
75 proto.month = getSetMonth;
76 proto.daysInMonth = getDaysInMonth;
79 import { getSetWeek, getSetISOWeek } from '../units/week';
80 proto.week = proto.weeks = getSetWeek;
81 proto.isoWeek = proto.isoWeeks = getSetISOWeek;
82 proto.weeksInYear = getWeeksInYear;
83 proto.isoWeeksInYear = getISOWeeksInYear;
86 import { getSetDayOfMonth } from '../units/day-of-month';
87 import { getSetDayOfWeek, getSetISODayOfWeek, getSetLocaleDayOfWeek } from '../units/day-of-week';
88 import { getSetDayOfYear } from '../units/day-of-year';
89 proto.date = getSetDayOfMonth;
90 proto.day = proto.days = getSetDayOfWeek;
91 proto.weekday = getSetLocaleDayOfWeek;
92 proto.isoWeekday = getSetISODayOfWeek;
93 proto.dayOfYear = getSetDayOfYear;
96 import { getSetHour } from '../units/hour';
97 proto.hour = proto.hours = getSetHour;
100 import { getSetMinute } from '../units/minute';
101 proto.minute = proto.minutes = getSetMinute;
104 import { getSetSecond } from '../units/second';
105 proto.second = proto.seconds = getSetSecond;
108 import { getSetMillisecond } from '../units/millisecond';
109 proto.millisecond = proto.milliseconds = getSetMillisecond;
116 setOffsetToParsedOffset,
117 hasAlignedHourOffset,
118 isDaylightSavingTime,
119 isDaylightSavingTimeShifted,
124 } from '../units/offset';
125 proto.utcOffset = getSetOffset;
126 proto.utc = setOffsetToUTC;
127 proto.local = setOffsetToLocal;
128 proto.parseZone = setOffsetToParsedOffset;
129 proto.hasAlignedHourOffset = hasAlignedHourOffset;
130 proto.isDST = isDaylightSavingTime;
131 proto.isDSTShifted = isDaylightSavingTimeShifted;
132 proto.isLocal = isLocal;
133 proto.isUtcOffset = isUtcOffset;
138 import { getZoneAbbr, getZoneName } from '../units/timezone';
139 proto.zoneAbbr = getZoneAbbr;
140 proto.zoneName = getZoneName;
143 import { deprecate } from '../utils/deprecate';
144 proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
145 proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
146 proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
147 proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
149 export default proto;