]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
comment out parser in units
authorMaggie Pint <magpint@microsoft.com>
Wed, 18 Jan 2017 11:43:18 +0000 (03:43 -0800)
committerMaggie Pint <magpint@microsoft.com>
Wed, 18 Jan 2017 11:43:18 +0000 (03:43 -0800)
15 files changed:
src/lib/locale/prototype.js
src/lib/units/day-of-month.js
src/lib/units/day-of-week.js
src/lib/units/day-of-year.js
src/lib/units/hour.js
src/lib/units/millisecond.js
src/lib/units/minute.js
src/lib/units/month.js
src/lib/units/offset.js
src/lib/units/quarter.js
src/lib/units/second.js
src/lib/units/timestamp.js
src/lib/units/week-year.js
src/lib/units/week.js
src/lib/units/year.js

index 24eef89f14b917821a40c003e4f4aba5ddf13e7b..64518c0a4c4288a9da204cf00d6894939aa4b2b6 100644 (file)
@@ -22,18 +22,18 @@ proto.set             = set;
 
 // Month
 import {
-    localeMonthsParse,
+   // localeMonthsParse,
     localeMonths,
     localeMonthsShort,
-    monthsRegex,
-    monthsShortRegex
+    // monthsRegex,
+    // monthsShortRegex
 } from '../units/month';
 
 proto.months            =        localeMonths;
 proto.monthsShort       =        localeMonthsShort;
-proto.monthsParse       =        localeMonthsParse;
-proto.monthsRegex       = monthsRegex;
-proto.monthsShortRegex  = monthsShortRegex;
+//proto.monthsParse       =        localeMonthsParse;
+// proto.monthsRegex       = monthsRegex;
+// proto.monthsShortRegex  = monthsShortRegex;
 
 // Week
 import { localeWeek, localeFirstDayOfYear, localeFirstDayOfWeek } from '../units/week';
@@ -43,24 +43,24 @@ proto.firstDayOfWeek = localeFirstDayOfWeek;
 
 // Day of Week
 import {
-    localeWeekdaysParse,
//   localeWeekdaysParse,
     localeWeekdays,
     localeWeekdaysMin,
     localeWeekdaysShort,
 
-    weekdaysRegex,
-    weekdaysShortRegex,
-    weekdaysMinRegex
+    // weekdaysRegex,
+    // weekdaysShortRegex,
+    // weekdaysMinRegex
 } from '../units/day-of-week';
 
 proto.weekdays       =        localeWeekdays;
 proto.weekdaysMin    =        localeWeekdaysMin;
 proto.weekdaysShort  =        localeWeekdaysShort;
-proto.weekdaysParse  =        localeWeekdaysParse;
+//proto.weekdaysParse  =        localeWeekdaysParse;
 
-proto.weekdaysRegex       =        weekdaysRegex;
-proto.weekdaysShortRegex  =        weekdaysShortRegex;
-proto.weekdaysMinRegex    =        weekdaysMinRegex;
+// proto.weekdaysRegex       =        weekdaysRegex;
+// proto.weekdaysShortRegex  =        weekdaysShortRegex;
+// proto.weekdaysMinRegex    =        weekdaysMinRegex;
 
 // Hours
 import { localeIsPM, localeMeridiem } from '../units/hour';
index e28ec9f4dd48dc2861de21e57736df0238a40193..5db13132da92e5384d164401a4c9e023757410a9 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2 } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2 } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { DATE } from './constants';
 import toInt from '../utils/to-int';
 
@@ -20,16 +20,16 @@ addUnitPriority('date', 9);
 
 // PARSING
 
-addRegexToken('D',  match1to2);
-addRegexToken('DD', match1to2, match2);
-addRegexToken('Do', function (isStrict, locale) {
-    return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
-});
+// addRegexToken('D',  match1to2);
+// addRegexToken('DD', match1to2, match2);
+// addRegexToken('Do', function (isStrict, locale) {
+//     return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+// });
 
-addParseToken(['D', 'DD'], DATE);
-addParseToken('Do', function (input, array) {
-    array[DATE] = toInt(input.match(match1to2)[0], 10);
-});
+// addParseToken(['D', 'DD'], DATE);
+// addParseToken('Do', function (input, array) {
+//     array[DATE] = toInt(input.match(match1to2)[0], 10);
+// });
 
 // MOMENTS
 
index 603192e289826be321687db6fa6f119d0e6b625b..d72eefb38cb30247b61b698936f3c452aa1b66d2 100644 (file)
@@ -1,8 +1,8 @@
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, matchWord, regexEscape } from '../parse/regex';
-import { addWeekParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, matchWord, regexEscape } from '../parse/regex';
+// import { addWeekParseToken } from '../parse/token';
 import toInt from '../utils/to-int';
 import isArray from '../utils/is-array';
 import indexOf from '../utils/index-of';
@@ -42,58 +42,58 @@ addUnitPriority('isoWeekday', 11);
 
 // PARSING
 
-addRegexToken('d',    match1to2);
-addRegexToken('e',    match1to2);
-addRegexToken('E',    match1to2);
-addRegexToken('dd',   function (isStrict, locale) {
-    return locale.weekdaysMinRegex(isStrict);
-});
-addRegexToken('ddd',   function (isStrict, locale) {
-    return locale.weekdaysShortRegex(isStrict);
-});
-addRegexToken('dddd',   function (isStrict, locale) {
-    return locale.weekdaysRegex(isStrict);
-});
-
-addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
-    var weekday = config._locale.weekdaysParse(input, token, config._strict);
-    // if we didn't get a weekday name, mark the date as invalid
-    if (weekday != null) {
-        week.d = weekday;
-    } else {
-        getParsingFlags(config).invalidWeekday = input;
-    }
-});
-
-addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
-    week[token] = toInt(input);
-});
+// addRegexToken('d',    match1to2);
+// addRegexToken('e',    match1to2);
+// addRegexToken('E',    match1to2);
+// addRegexToken('dd',   function (isStrict, locale) {
+//     return locale.weekdaysMinRegex(isStrict);
+// });
+// addRegexToken('ddd',   function (isStrict, locale) {
+//     return locale.weekdaysShortRegex(isStrict);
+// });
+// addRegexToken('dddd',   function (isStrict, locale) {
+//     return locale.weekdaysRegex(isStrict);
+// });
+
+// addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
+//     var weekday = config._locale.weekdaysParse(input, token, config._strict);
+//     // if we didn't get a weekday name, mark the date as invalid
+//     if (weekday != null) {
+//         week.d = weekday;
+//     } else {
+//         getParsingFlags(config).invalidWeekday = input;
+//     }
+// });
+
+// addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+//     week[token] = toInt(input);
+// });
 
 // HELPERS
 
-function parseWeekday(input, locale) {
-    if (typeof input !== 'string') {
-        return input;
-    }
+// function parseWeekday(input, locale) {
+//     if (typeof input !== 'string') {
+//         return input;
+//     }
 
-    if (!isNaN(input)) {
-        return parseInt(input, 10);
-    }
+//     if (!isNaN(input)) {
+//         return parseInt(input, 10);
+//     }
 
-    input = locale.weekdaysParse(input);
-    if (typeof input === 'number') {
-        return input;
-    }
+//     input = locale.weekdaysParse(input);
+//     if (typeof input === 'number') {
+//         return input;
+//     }
 
-    return null;
-}
+//     return null;
+// }
 
-function parseIsoWeekday(input, locale) {
-    if (typeof input === 'string') {
-        return locale.weekdaysParse(input) % 7 || 7;
-    }
-    return isNaN(input) ? null : input;
-}
+// function parseIsoWeekday(input, locale) {
+//     if (typeof input === 'string') {
+//         return locale.weekdaysParse(input) % 7 || 7;
+//     }
+//     return isNaN(input) ? null : input;
+// }
 
 // LOCALES
 
@@ -116,109 +116,109 @@ export function localeWeekdaysMin (m) {
     return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
 }
 
-function handleStrictParse(weekdayName, format, strict) {
-    var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
-    if (!this._weekdaysParse) {
-        this._weekdaysParse = [];
-        this._shortWeekdaysParse = [];
-        this._minWeekdaysParse = [];
-
-        for (i = 0; i < 7; ++i) {
-            mom = createUTC([2000, 1]).day(i);
-            this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
-            this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
-            this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
-        }
-    }
-
-    if (strict) {
-        if (format === 'dddd') {
-            ii = indexOf.call(this._weekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        } else if (format === 'ddd') {
-            ii = indexOf.call(this._shortWeekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        } else {
-            ii = indexOf.call(this._minWeekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        }
-    } else {
-        if (format === 'dddd') {
-            ii = indexOf.call(this._weekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._shortWeekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._minWeekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        } else if (format === 'ddd') {
-            ii = indexOf.call(this._shortWeekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._weekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._minWeekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        } else {
-            ii = indexOf.call(this._minWeekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._weekdaysParse, llc);
-            if (ii !== -1) {
-                return ii;
-            }
-            ii = indexOf.call(this._shortWeekdaysParse, llc);
-            return ii !== -1 ? ii : null;
-        }
-    }
-}
-
-export function localeWeekdaysParse (weekdayName, format, strict) {
-    var i, mom, regex;
-
-    if (this._weekdaysParseExact) {
-        return handleStrictParse.call(this, weekdayName, format, strict);
-    }
-
-    if (!this._weekdaysParse) {
-        this._weekdaysParse = [];
-        this._minWeekdaysParse = [];
-        this._shortWeekdaysParse = [];
-        this._fullWeekdaysParse = [];
-    }
-
-    for (i = 0; i < 7; i++) {
-        // make the regex if we don't have it already
-
-        mom = createUTC([2000, 1]).day(i);
-        if (strict && !this._fullWeekdaysParse[i]) {
-            this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
-            this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
-            this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
-        }
-        if (!this._weekdaysParse[i]) {
-            regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
-            this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
-        }
-        // test the regex
-        if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
-            return i;
-        } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
-            return i;
-        } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
-            return i;
-        } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
-            return i;
-        }
-    }
-}
+// function handleStrictParse(weekdayName, format, strict) {
+//     var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
+//     if (!this._weekdaysParse) {
+//         this._weekdaysParse = [];
+//         this._shortWeekdaysParse = [];
+//         this._minWeekdaysParse = [];
+
+//         for (i = 0; i < 7; ++i) {
+//             mom = createUTC([2000, 1]).day(i);
+//             this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
+//             this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
+//             this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
+//         }
+//     }
+
+//     if (strict) {
+//         if (format === 'dddd') {
+//             ii = indexOf.call(this._weekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         } else if (format === 'ddd') {
+//             ii = indexOf.call(this._shortWeekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         } else {
+//             ii = indexOf.call(this._minWeekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         }
+//     } else {
+//         if (format === 'dddd') {
+//             ii = indexOf.call(this._weekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._shortWeekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._minWeekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         } else if (format === 'ddd') {
+//             ii = indexOf.call(this._shortWeekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._weekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._minWeekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         } else {
+//             ii = indexOf.call(this._minWeekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._weekdaysParse, llc);
+//             if (ii !== -1) {
+//                 return ii;
+//             }
+//             ii = indexOf.call(this._shortWeekdaysParse, llc);
+//             return ii !== -1 ? ii : null;
+//         }
+//     }
+// }
+
+// export function localeWeekdaysParse (weekdayName, format, strict) {
+//     var i, mom, regex;
+
+//     if (this._weekdaysParseExact) {
+//         return handleStrictParse.call(this, weekdayName, format, strict);
+//     }
+
+//     if (!this._weekdaysParse) {
+//         this._weekdaysParse = [];
+//         this._minWeekdaysParse = [];
+//         this._shortWeekdaysParse = [];
+//         this._fullWeekdaysParse = [];
+//     }
+
+//     for (i = 0; i < 7; i++) {
+//         // make the regex if we don't have it already
+
+//         mom = createUTC([2000, 1]).day(i);
+//         if (strict && !this._fullWeekdaysParse[i]) {
+//             this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
+//             this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
+//             this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
+//         }
+//         if (!this._weekdaysParse[i]) {
+//             regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+//             this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+//         }
+//         // test the regex
+//         if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
+//             return i;
+//         } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
+//             return i;
+//         } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
+//             return i;
+//         } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
+//             return i;
+//         }
+//     }
+// }
 
 // MOMENTS
 
@@ -260,65 +260,65 @@ export function getSetISODayOfWeek (input) {
     }
 }
 
-var defaultWeekdaysRegex = matchWord;
-export function weekdaysRegex (isStrict) {
-    if (this._weekdaysParseExact) {
-        if (!hasOwnProp(this, '_weekdaysRegex')) {
-            computeWeekdaysParse.call(this);
-        }
-        if (isStrict) {
-            return this._weekdaysStrictRegex;
-        } else {
-            return this._weekdaysRegex;
-        }
-    } else {
-        if (!hasOwnProp(this, '_weekdaysRegex')) {
-            this._weekdaysRegex = defaultWeekdaysRegex;
-        }
-        return this._weekdaysStrictRegex && isStrict ?
-            this._weekdaysStrictRegex : this._weekdaysRegex;
-    }
-}
-
-var defaultWeekdaysShortRegex = matchWord;
-export function weekdaysShortRegex (isStrict) {
-    if (this._weekdaysParseExact) {
-        if (!hasOwnProp(this, '_weekdaysRegex')) {
-            computeWeekdaysParse.call(this);
-        }
-        if (isStrict) {
-            return this._weekdaysShortStrictRegex;
-        } else {
-            return this._weekdaysShortRegex;
-        }
-    } else {
-        if (!hasOwnProp(this, '_weekdaysShortRegex')) {
-            this._weekdaysShortRegex = defaultWeekdaysShortRegex;
-        }
-        return this._weekdaysShortStrictRegex && isStrict ?
-            this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
-    }
-}
-
-var defaultWeekdaysMinRegex = matchWord;
-export function weekdaysMinRegex (isStrict) {
-    if (this._weekdaysParseExact) {
-        if (!hasOwnProp(this, '_weekdaysRegex')) {
-            computeWeekdaysParse.call(this);
-        }
-        if (isStrict) {
-            return this._weekdaysMinStrictRegex;
-        } else {
-            return this._weekdaysMinRegex;
-        }
-    } else {
-        if (!hasOwnProp(this, '_weekdaysMinRegex')) {
-            this._weekdaysMinRegex = defaultWeekdaysMinRegex;
-        }
-        return this._weekdaysMinStrictRegex && isStrict ?
-            this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
-    }
-}
+// var defaultWeekdaysRegex = matchWord;
+// export function weekdaysRegex (isStrict) {
+//     if (this._weekdaysParseExact) {
+//         if (!hasOwnProp(this, '_weekdaysRegex')) {
+//             computeWeekdaysParse.call(this);
+//         }
+//         if (isStrict) {
+//             return this._weekdaysStrictRegex;
+//         } else {
+//             return this._weekdaysRegex;
+//         }
+//     } else {
+//         if (!hasOwnProp(this, '_weekdaysRegex')) {
+//             this._weekdaysRegex = defaultWeekdaysRegex;
+//         }
+//         return this._weekdaysStrictRegex && isStrict ?
+//             this._weekdaysStrictRegex : this._weekdaysRegex;
+//     }
+// }
+
+// var defaultWeekdaysShortRegex = matchWord;
+// export function weekdaysShortRegex (isStrict) {
+//     if (this._weekdaysParseExact) {
+//         if (!hasOwnProp(this, '_weekdaysRegex')) {
+//             computeWeekdaysParse.call(this);
+//         }
+//         if (isStrict) {
+//             return this._weekdaysShortStrictRegex;
+//         } else {
+//             return this._weekdaysShortRegex;
+//         }
+//     } else {
+//         if (!hasOwnProp(this, '_weekdaysShortRegex')) {
+//             this._weekdaysShortRegex = defaultWeekdaysShortRegex;
+//         }
+//         return this._weekdaysShortStrictRegex && isStrict ?
+//             this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
+//     }
+// }
+
+// var defaultWeekdaysMinRegex = matchWord;
+// export function weekdaysMinRegex (isStrict) {
+//     if (this._weekdaysParseExact) {
+//         if (!hasOwnProp(this, '_weekdaysRegex')) {
+//             computeWeekdaysParse.call(this);
+//         }
+//         if (isStrict) {
+//             return this._weekdaysMinStrictRegex;
+//         } else {
+//             return this._weekdaysMinRegex;
+//         }
+//     } else {
+//         if (!hasOwnProp(this, '_weekdaysMinRegex')) {
+//             this._weekdaysMinRegex = defaultWeekdaysMinRegex;
+//         }
+//         return this._weekdaysMinStrictRegex && isStrict ?
+//             this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
+//     }
+// }
 
 
 function computeWeekdaysParse () {
index 6fe931c1e46fbe36794d9b30d0f55c3ebac521bd..29ae71d5f265b9543824a5352799bb19d42e34a1 100644 (file)
@@ -20,11 +20,11 @@ addUnitPriority('dayOfYear', 4);
 
 // PARSING
 
-addRegexToken('DDD',  match1to3);
-addRegexToken('DDDD', match3);
-addParseToken(['DDD', 'DDDD'], function (input, array, config) {
-    config._dayOfYear = toInt(input);
-});
+// addRegexToken('DDD',  match1to3);
+// addRegexToken('DDDD', match3);
+// addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+//     config._dayOfYear = toInt(input);
+// });
 
 // HELPERS
 
index d5733fbbcfa38d6fd48ddd8a2c455cf34baea9bb..05407918deea7bc066d900c3f9e31d0f95256c5c 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2, match3to4, match5to6 } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2, match3to4, match5to6 } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { HOUR, MINUTE, SECOND } from './constants';
 import toInt from '../utils/to-int';
 import zeroFill from '../utils/zero-fill';
@@ -59,57 +59,57 @@ addUnitPriority('hour', 13);
 
 // PARSING
 
-function matchMeridiem (isStrict, locale) {
-    return locale._meridiemParse;
-}
-
-addRegexToken('a',  matchMeridiem);
-addRegexToken('A',  matchMeridiem);
-addRegexToken('H',  match1to2);
-addRegexToken('h',  match1to2);
-addRegexToken('HH', match1to2, match2);
-addRegexToken('hh', match1to2, match2);
-
-addRegexToken('hmm', match3to4);
-addRegexToken('hmmss', match5to6);
-addRegexToken('Hmm', match3to4);
-addRegexToken('Hmmss', match5to6);
-
-addParseToken(['H', 'HH'], HOUR);
-addParseToken(['a', 'A'], function (input, array, config) {
-    config._isPm = config._locale.isPM(input);
-    config._meridiem = input;
-});
-addParseToken(['h', 'hh'], function (input, array, config) {
-    array[HOUR] = toInt(input);
-    getParsingFlags(config).bigHour = true;
-});
-addParseToken('hmm', function (input, array, config) {
-    var pos = input.length - 2;
-    array[HOUR] = toInt(input.substr(0, pos));
-    array[MINUTE] = toInt(input.substr(pos));
-    getParsingFlags(config).bigHour = true;
-});
-addParseToken('hmmss', function (input, array, config) {
-    var pos1 = input.length - 4;
-    var pos2 = input.length - 2;
-    array[HOUR] = toInt(input.substr(0, pos1));
-    array[MINUTE] = toInt(input.substr(pos1, 2));
-    array[SECOND] = toInt(input.substr(pos2));
-    getParsingFlags(config).bigHour = true;
-});
-addParseToken('Hmm', function (input, array, config) {
-    var pos = input.length - 2;
-    array[HOUR] = toInt(input.substr(0, pos));
-    array[MINUTE] = toInt(input.substr(pos));
-});
-addParseToken('Hmmss', function (input, array, config) {
-    var pos1 = input.length - 4;
-    var pos2 = input.length - 2;
-    array[HOUR] = toInt(input.substr(0, pos1));
-    array[MINUTE] = toInt(input.substr(pos1, 2));
-    array[SECOND] = toInt(input.substr(pos2));
-});
+// function matchMeridiem (isStrict, locale) {
+//     return locale._meridiemParse;
+// }
+
+// addRegexToken('a',  matchMeridiem);
+// addRegexToken('A',  matchMeridiem);
+// addRegexToken('H',  match1to2);
+// addRegexToken('h',  match1to2);
+// addRegexToken('HH', match1to2, match2);
+// addRegexToken('hh', match1to2, match2);
+
+// addRegexToken('hmm', match3to4);
+// addRegexToken('hmmss', match5to6);
+// addRegexToken('Hmm', match3to4);
+// addRegexToken('Hmmss', match5to6);
+
+// addParseToken(['H', 'HH'], HOUR);
+// addParseToken(['a', 'A'], function (input, array, config) {
+//     config._isPm = config._locale.isPM(input);
+//     config._meridiem = input;
+// });
+// addParseToken(['h', 'hh'], function (input, array, config) {
+//     array[HOUR] = toInt(input);
+//     getParsingFlags(config).bigHour = true;
+// });
+// addParseToken('hmm', function (input, array, config) {
+//     var pos = input.length - 2;
+//     array[HOUR] = toInt(input.substr(0, pos));
+//     array[MINUTE] = toInt(input.substr(pos));
+//     getParsingFlags(config).bigHour = true;
+// });
+// addParseToken('hmmss', function (input, array, config) {
+//     var pos1 = input.length - 4;
+//     var pos2 = input.length - 2;
+//     array[HOUR] = toInt(input.substr(0, pos1));
+//     array[MINUTE] = toInt(input.substr(pos1, 2));
+//     array[SECOND] = toInt(input.substr(pos2));
+//     getParsingFlags(config).bigHour = true;
+// });
+// addParseToken('Hmm', function (input, array, config) {
+//     var pos = input.length - 2;
+//     array[HOUR] = toInt(input.substr(0, pos));
+//     array[MINUTE] = toInt(input.substr(pos));
+// });
+// addParseToken('Hmmss', function (input, array, config) {
+//     var pos1 = input.length - 4;
+//     var pos2 = input.length - 2;
+//     array[HOUR] = toInt(input.substr(0, pos1));
+//     array[MINUTE] = toInt(input.substr(pos1, 2));
+//     array[SECOND] = toInt(input.substr(pos2));
+// });
 
 // LOCALES
 
index 27c951269360e0498145fbf04d6c6de4e7950144..0de530eb5e951badc89948eda8591d787ef1921b 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1, match2, match3, match1to3, matchUnsigned } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1, match2, match3, match1to3, matchUnsigned } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { MILLISECOND } from './constants';
 import toInt from '../utils/to-int';
 
@@ -48,22 +48,22 @@ addUnitPriority('millisecond', 16);
 
 // PARSING
 
-addRegexToken('S',    match1to3, match1);
-addRegexToken('SS',   match1to3, match2);
-addRegexToken('SSS',  match1to3, match3);
+// addRegexToken('S',    match1to3, match1);
+// addRegexToken('SS',   match1to3, match2);
+// addRegexToken('SSS',  match1to3, match3);
 
-var token;
-for (token = 'SSSS'; token.length <= 9; token += 'S') {
-    addRegexToken(token, matchUnsigned);
-}
+// var token;
+// for (token = 'SSSS'; token.length <= 9; token += 'S') {
+//     addRegexToken(token, matchUnsigned);
+// }
 
-function parseMs(input, array) {
-    array[MILLISECOND] = toInt(('0.' + input) * 1000);
-}
+// function parseMs(input, array) {
+//     array[MILLISECOND] = toInt(('0.' + input) * 1000);
+// }
 
-for (token = 'S'; token.length <= 9; token += 'S') {
-    addParseToken(token, parseMs);
-}
+// for (token = 'S'; token.length <= 9; token += 'S') {
+//     addParseToken(token, parseMs);
+// }
 // MOMENTS
 
 export var getSetMillisecond = makeGetSet('Milliseconds', false);
index 9f760322e1340536235dc71fd9d71cd968effde2..b82b34e03496ad011aaf34e793e203ab6828b5d1 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2 } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2 } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { MINUTE } from './constants';
 
 // FORMATTING
@@ -20,9 +20,9 @@ addUnitPriority('minute', 14);
 
 // PARSING
 
-addRegexToken('m',  match1to2);
-addRegexToken('mm', match1to2, match2);
-addParseToken(['m', 'mm'], MINUTE);
+// addRegexToken('m',  match1to2);
+// addRegexToken('mm', match1to2, match2);
+// addParseToken(['m', 'mm'], MINUTE);
 
 // MOMENTS
 
index e454d678a1377969f8a967dd92a0ea6c7b1728e9..0c990c4c4a3c0c3c4582aca7b571cc0e482707c4 100644 (file)
@@ -3,8 +3,8 @@ import hasOwnProp from '../utils/has-own-prop';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2, matchWord, regexEscape } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2, matchWord, regexEscape } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { hooks } from '../utils/hooks';
 import { MONTH } from './constants';
 import toInt from '../utils/to-int';
@@ -42,28 +42,28 @@ addUnitPriority('month', 8);
 
 // PARSING
 
-addRegexToken('M',    match1to2);
-addRegexToken('MM',   match1to2, match2);
-addRegexToken('MMM',  function (isStrict, locale) {
-    return locale.monthsShortRegex(isStrict);
-});
-addRegexToken('MMMM', function (isStrict, locale) {
-    return locale.monthsRegex(isStrict);
-});
-
-addParseToken(['M', 'MM'], function (input, array) {
-    array[MONTH] = toInt(input) - 1;
-});
-
-addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
-    var month = config._locale.monthsParse(input, token, config._strict);
-    // if we didn't find a month name, mark the date as invalid.
-    if (month != null) {
-        array[MONTH] = month;
-    } else {
-        getParsingFlags(config).invalidMonth = input;
-    }
-});
+// addRegexToken('M',    match1to2);
+// addRegexToken('MM',   match1to2, match2);
+// addRegexToken('MMM',  function (isStrict, locale) {
+//     return locale.monthsShortRegex(isStrict);
+// });
+// addRegexToken('MMMM', function (isStrict, locale) {
+//     return locale.monthsRegex(isStrict);
+// });
+
+// addParseToken(['M', 'MM'], function (input, array) {
+//     array[MONTH] = toInt(input) - 1;
+// });
+
+// addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+//     var month = config._locale.monthsParse(input, token, config._strict);
+//     // if we didn't find a month name, mark the date as invalid.
+//     if (month != null) {
+//         array[MONTH] = month;
+//     } else {
+//         getParsingFlags(config).invalidMonth = input;
+//     }
+// });
 
 // LOCALES
 
@@ -127,43 +127,43 @@ function handleStrictParse(monthName, format, strict) {
     }
 }
 
-export function localeMonthsParse (monthName, format, strict) {
-    var i, mom, regex;
-
-    if (this._monthsParseExact) {
-        return handleStrictParse.call(this, monthName, format, strict);
-    }
-
-    if (!this._monthsParse) {
-        this._monthsParse = [];
-        this._longMonthsParse = [];
-        this._shortMonthsParse = [];
-    }
-
-    // TODO: add sorting
-    // Sorting makes sure if one month (or abbr) is a prefix of another
-    // see sorting in computeMonthsParse
-    for (i = 0; i < 12; i++) {
-        // make the regex if we don't have it already
-        mom = createUTC([2000, i]);
-        if (strict && !this._longMonthsParse[i]) {
-            this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
-            this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
-        }
-        if (!strict && !this._monthsParse[i]) {
-            regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
-            this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
-        }
-        // test the regex
-        if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
-            return i;
-        } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
-            return i;
-        } else if (!strict && this._monthsParse[i].test(monthName)) {
-            return i;
-        }
-    }
-}
+// export function localeMonthsParse (monthName, format, strict) {
+//     var i, mom, regex;
+
+//     if (this._monthsParseExact) {
+//         return handleStrictParse.call(this, monthName, format, strict);
+//     }
+
+//     if (!this._monthsParse) {
+//         this._monthsParse = [];
+//         this._longMonthsParse = [];
+//         this._shortMonthsParse = [];
+//     }
+
+//     // TODO: add sorting
+//     // Sorting makes sure if one month (or abbr) is a prefix of another
+//     // see sorting in computeMonthsParse
+//     for (i = 0; i < 12; i++) {
+//         // make the regex if we don't have it already
+//         mom = createUTC([2000, i]);
+//         if (strict && !this._longMonthsParse[i]) {
+//             this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+//             this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+//         }
+//         if (!strict && !this._monthsParse[i]) {
+//             regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+//             this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+//         }
+//         // test the regex
+//         if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+//             return i;
+//         } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+//             return i;
+//         } else if (!strict && this._monthsParse[i].test(monthName)) {
+//             return i;
+//         }
+//     }
+// }
 
 // MOMENTS
 
@@ -206,76 +206,76 @@ export function getDaysInMonth () {
     return daysInMonth(this.year(), this.month());
 }
 
-var defaultMonthsShortRegex = matchWord;
-export function monthsShortRegex (isStrict) {
-    if (this._monthsParseExact) {
-        if (!hasOwnProp(this, '_monthsRegex')) {
-            computeMonthsParse.call(this);
-        }
-        if (isStrict) {
-            return this._monthsShortStrictRegex;
-        } else {
-            return this._monthsShortRegex;
-        }
-    } else {
-        if (!hasOwnProp(this, '_monthsShortRegex')) {
-            this._monthsShortRegex = defaultMonthsShortRegex;
-        }
-        return this._monthsShortStrictRegex && isStrict ?
-            this._monthsShortStrictRegex : this._monthsShortRegex;
-    }
-}
-
-var defaultMonthsRegex = matchWord;
-export function monthsRegex (isStrict) {
-    if (this._monthsParseExact) {
-        if (!hasOwnProp(this, '_monthsRegex')) {
-            computeMonthsParse.call(this);
-        }
-        if (isStrict) {
-            return this._monthsStrictRegex;
-        } else {
-            return this._monthsRegex;
-        }
-    } else {
-        if (!hasOwnProp(this, '_monthsRegex')) {
-            this._monthsRegex = defaultMonthsRegex;
-        }
-        return this._monthsStrictRegex && isStrict ?
-            this._monthsStrictRegex : this._monthsRegex;
-    }
-}
-
-function computeMonthsParse () {
-    function cmpLenRev(a, b) {
-        return b.length - a.length;
-    }
-
-    var shortPieces = [], longPieces = [], mixedPieces = [],
-        i, mom;
-    for (i = 0; i < 12; i++) {
-        // make the regex if we don't have it already
-        mom = createUTC([2000, i]);
-        shortPieces.push(this.monthsShort(mom, ''));
-        longPieces.push(this.months(mom, ''));
-        mixedPieces.push(this.months(mom, ''));
-        mixedPieces.push(this.monthsShort(mom, ''));
-    }
-    // Sorting makes sure if one month (or abbr) is a prefix of another it
-    // will match the longer piece.
-    shortPieces.sort(cmpLenRev);
-    longPieces.sort(cmpLenRev);
-    mixedPieces.sort(cmpLenRev);
-    for (i = 0; i < 12; i++) {
-        shortPieces[i] = regexEscape(shortPieces[i]);
-        longPieces[i] = regexEscape(longPieces[i]);
-    }
-    for (i = 0; i < 24; i++) {
-        mixedPieces[i] = regexEscape(mixedPieces[i]);
-    }
-
-    this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
-    this._monthsShortRegex = this._monthsRegex;
-    this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
-    this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
-}
+// var defaultMonthsShortRegex = matchWord;
+// export function monthsShortRegex (isStrict) {
+//     if (this._monthsParseExact) {
+//         if (!hasOwnProp(this, '_monthsRegex')) {
+//             computeMonthsParse.call(this);
+//         }
+//         if (isStrict) {
+//             return this._monthsShortStrictRegex;
+//         } else {
+//             return this._monthsShortRegex;
+//         }
+//     } else {
+//         if (!hasOwnProp(this, '_monthsShortRegex')) {
+//             this._monthsShortRegex = defaultMonthsShortRegex;
+//         }
+//         return this._monthsShortStrictRegex && isStrict ?
+//             this._monthsShortStrictRegex : this._monthsShortRegex;
+//     }
+// }
+
+// var defaultMonthsRegex = matchWord;
+// export function monthsRegex (isStrict) {
+//     if (this._monthsParseExact) {
+//         if (!hasOwnProp(this, '_monthsRegex')) {
+//             computeMonthsParse.call(this);
+//         }
+//         if (isStrict) {
+//             return this._monthsStrictRegex;
+//         } else {
+//             return this._monthsRegex;
+//         }
+//     } else {
+//         if (!hasOwnProp(this, '_monthsRegex')) {
+//             this._monthsRegex = defaultMonthsRegex;
+//         }
+//         return this._monthsStrictRegex && isStrict ?
+//             this._monthsStrictRegex : this._monthsRegex;
+//     }
+// }
+
+// function computeMonthsParse () {
+//     function cmpLenRev(a, b) {
+//         return b.length - a.length;
+//     }
+
+//     var shortPieces = [], longPieces = [], mixedPieces = [],
+//         i, mom;
+//     for (i = 0; i < 12; i++) {
+//         // make the regex if we don't have it already
+//         mom = createUTC([2000, i]);
+//         shortPieces.push(this.monthsShort(mom, ''));
+//         longPieces.push(this.months(mom, ''));
+//         mixedPieces.push(this.months(mom, ''));
+//         mixedPieces.push(this.monthsShort(mom, ''));
+//     }
+//     // Sorting makes sure if one month (or abbr) is a prefix of another it
+//     // will match the longer piece.
+//     shortPieces.sort(cmpLenRev);
+//     longPieces.sort(cmpLenRev);
+//     mixedPieces.sort(cmpLenRev);
+//     for (i = 0; i < 12; i++) {
+//         shortPieces[i] = regexEscape(shortPieces[i]);
+//         longPieces[i] = regexEscape(longPieces[i]);
+//     }
+//     for (i = 0; i < 24; i++) {
+//         mixedPieces[i] = regexEscape(mixedPieces[i]);
+//     }
+
+//     this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
+//     this._monthsShortRegex = this._monthsRegex;
+//     this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
+//     this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
+// }
index 168aeadd808610444d6d4aa1437fd40aa9252ec0..612adb8a08e81c911a64c91ec430379466897de7 100644 (file)
@@ -3,8 +3,8 @@ import { createDuration } from '../duration/create';
 import { addSubtract } from '../moment/add-subtract';
 import { isMoment, copyConfig } from '../moment/constructor';
 import { addFormatToken } from '../format/format';
-import { addRegexToken, matchOffset, matchShortOffset } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, matchOffset, matchShortOffset } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { createLocal } from '../create/local';
 import { prepareConfig } from '../create/from-anything';
 import { createUTC } from '../create/utc';
@@ -33,12 +33,12 @@ offset('ZZ', '');
 
 // PARSING
 
-addRegexToken('Z',  matchShortOffset);
-addRegexToken('ZZ', matchShortOffset);
-addParseToken(['Z', 'ZZ'], function (input, array, config) {
-    config._useUTC = true;
-    config._tzm = offsetFromString(matchShortOffset, input);
-});
+// addRegexToken('Z',  matchShortOffset);
+// addRegexToken('ZZ', matchShortOffset);
+// addParseToken(['Z', 'ZZ'], function (input, array, config) {
+//     config._useUTC = true;
+//     config._tzm = offsetFromString(matchShortOffset, input);
+// });
 
 // HELPERS
 
index a6d409a862c8108e29d47effa0dc9b1070a94ff0..121223a16bcd16047d19bd5c9580dc1e2a221fdd 100644 (file)
@@ -20,10 +20,10 @@ addUnitPriority('quarter', 7);
 
 // PARSING
 
-addRegexToken('Q', match1);
-addParseToken('Q', function (input, array) {
-    array[MONTH] = (toInt(input) - 1) * 3;
-});
+// addRegexToken('Q', match1);
+// addParseToken('Q', function (input, array) {
+//     array[MONTH] = (toInt(input) - 1) * 3;
+// });
 
 // MOMENTS
 
index 179371186e98f1749443a37951d4fc58612ce99f..afbd9b7cc7a73a158691a7720324a891386814fe 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2 } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2 } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { SECOND } from './constants';
 
 // FORMATTING
@@ -18,11 +18,11 @@ addUnitAlias('second', 's');
 
 addUnitPriority('second', 15);
 
-// PARSING
+// // PARSING
 
-addRegexToken('s',  match1to2);
-addRegexToken('ss', match1to2, match2);
-addParseToken(['s', 'ss'], SECOND);
+// addRegexToken('s',  match1to2);
+// addRegexToken('ss', match1to2, match2);
+// addParseToken(['s', 'ss'], SECOND);
 
 // MOMENTS
 
index a49e1e4b852e1c01a04c8655534e9e74947e7cc1..4ea963c2959c9eb6d81b662a16c549f81449d21f 100644 (file)
@@ -10,11 +10,11 @@ addFormatToken('x', 0, 0, 'valueOf');
 
 // PARSING
 
-addRegexToken('x', matchSigned);
-addRegexToken('X', matchTimestamp);
-addParseToken('X', function (input, array, config) {
-    config._d = new Date(parseFloat(input, 10) * 1000);
-});
-addParseToken('x', function (input, array, config) {
-    config._d = new Date(toInt(input));
-});
+// addRegexToken('x', matchSigned);
+// addRegexToken('X', matchTimestamp);
+// addParseToken('X', function (input, array, config) {
+//     config._d = new Date(parseFloat(input, 10) * 1000);
+// });
+// addParseToken('x', function (input, array, config) {
+//     config._d = new Date(toInt(input));
+// });
index 7fa5425bccbf4d0a62e28801c2e9a4ef6da492b8..cf22dfc5ed11c7c856649113c8c03a7cc80b981b 100644 (file)
@@ -1,8 +1,8 @@
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';
-import { addWeekParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';
+// import { addWeekParseToken } from '../parse/token';
 import { weekOfYear, weeksInYear, dayOfYearFromWeeks } from './week-calendar-utils';
 import toInt from '../utils/to-int';
 import { hooks } from '../utils/hooks';
@@ -41,22 +41,22 @@ addUnitPriority('isoWeekYear', 1);
 
 // PARSING
 
-addRegexToken('G',      matchSigned);
-addRegexToken('g',      matchSigned);
-addRegexToken('GG',     match1to2, match2);
-addRegexToken('gg',     match1to2, match2);
-addRegexToken('GGGG',   match1to4, match4);
-addRegexToken('gggg',   match1to4, match4);
-addRegexToken('GGGGG',  match1to6, match6);
-addRegexToken('ggggg',  match1to6, match6);
-
-addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
-    week[token.substr(0, 2)] = toInt(input);
-});
-
-addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
-    week[token] = hooks.parseTwoDigitYear(input);
-});
+// addRegexToken('G',      matchSigned);
+// addRegexToken('g',      matchSigned);
+// addRegexToken('GG',     match1to2, match2);
+// addRegexToken('gg',     match1to2, match2);
+// addRegexToken('GGGG',   match1to4, match4);
+// addRegexToken('gggg',   match1to4, match4);
+// addRegexToken('GGGGG',  match1to6, match6);
+// addRegexToken('ggggg',  match1to6, match6);
+
+// addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+//     week[token.substr(0, 2)] = toInt(input);
+// });
+
+// addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+//     week[token] = hooks.parseTwoDigitYear(input);
+// });
 
 // MOMENTS
 
index da64ffef328a68491c6211b2fbc350ed4d96100c..2450491c2e939c53c0643cd0c8e4fbe7380a99a3 100644 (file)
@@ -1,8 +1,8 @@
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match2 } from '../parse/regex';
-import { addWeekParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match2 } from '../parse/regex';
+// import { addWeekParseToken } from '../parse/token';
 import toInt from '../utils/to-int';
 import { createLocal } from '../create/local';
 import { weekOfYear } from './week-calendar-utils';
@@ -24,14 +24,14 @@ addUnitPriority('isoWeek', 5);
 
 // PARSING
 
-addRegexToken('w',  match1to2);
-addRegexToken('ww', match1to2, match2);
-addRegexToken('W',  match1to2);
-addRegexToken('WW', match1to2, match2);
+// addRegexToken('w',  match1to2);
+// addRegexToken('ww', match1to2, match2);
+// addRegexToken('W',  match1to2);
+// addRegexToken('WW', match1to2, match2);
 
-addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
-    week[token.substr(0, 1)] = toInt(input);
-});
+// addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+//     week[token.substr(0, 1)] = toInt(input);
+// });
 
 // HELPERS
 
index a10e5b4beb3588238208508569b7c4f953aede7e..8c51ec3917f745cd1374287f61805195ca99f9e5 100644 (file)
@@ -2,8 +2,8 @@ import { makeGetSet } from '../moment/get-set';
 import { addFormatToken } from '../format/format';
 import { addUnitAlias } from './aliases';
 import { addUnitPriority } from './priorities';
-import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';
-import { addParseToken } from '../parse/token';
+// import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';
+// import { addParseToken } from '../parse/token';
 import { hooks } from '../utils/hooks';
 import { YEAR } from './constants';
 import toInt from '../utils/to-int';
@@ -31,24 +31,24 @@ addUnitAlias('year', 'y');
 
 addUnitPriority('year', 1);
 
-// PARSING
-
-addRegexToken('Y',      matchSigned);
-addRegexToken('YY',     match1to2, match2);
-addRegexToken('YYYY',   match1to4, match4);
-addRegexToken('YYYYY',  match1to6, match6);
-addRegexToken('YYYYYY', match1to6, match6);
-
-addParseToken(['YYYYY', 'YYYYYY'], YEAR);
-addParseToken('YYYY', function (input, array) {
-    array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
-});
-addParseToken('YY', function (input, array) {
-    array[YEAR] = hooks.parseTwoDigitYear(input);
-});
-addParseToken('Y', function (input, array) {
-    array[YEAR] = parseInt(input, 10);
-});
+// // PARSING
+
+// addRegexToken('Y',      matchSigned);
+// addRegexToken('YY',     match1to2, match2);
+// addRegexToken('YYYY',   match1to4, match4);
+// addRegexToken('YYYYY',  match1to6, match6);
+// addRegexToken('YYYYYY', match1to6, match6);
+
+// addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+// addParseToken('YYYY', function (input, array) {
+//     array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
+// });
+// addParseToken('YY', function (input, array) {
+//     array[YEAR] = hooks.parseTwoDigitYear(input);
+// });
+// addParseToken('Y', function (input, array) {
+//     array[YEAR] = parseInt(input, 10);
+// });
 
 // HELPERS