c4e735f42584b0d3e77df4be68b011d0.json
15.6 KB
{"ast":null,"code":"export var WEEK_DAY_COUNT = 7;\nexport function isNullEqual(value1, value2) {\n if (!value1 && !value2) {\n return true;\n }\n\n if (!value1 || !value2) {\n return false;\n }\n\n return undefined;\n}\nexport function isSameDecade(generateConfig, decade1, decade2) {\n var equal = isNullEqual(decade1, decade2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n var num1 = Math.floor(generateConfig.getYear(decade1) / 10);\n var num2 = Math.floor(generateConfig.getYear(decade2) / 10);\n return num1 === num2;\n}\nexport function isSameYear(generateConfig, year1, year2) {\n var equal = isNullEqual(year1, year2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getYear(year1) === generateConfig.getYear(year2);\n}\nexport function getQuarter(generateConfig, date) {\n var quota = Math.floor(generateConfig.getMonth(date) / 3);\n return quota + 1;\n}\nexport function isSameQuarter(generateConfig, quarter1, quarter2) {\n var equal = isNullEqual(quarter1, quarter2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return isSameYear(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);\n}\nexport function isSameMonth(generateConfig, month1, month2) {\n var equal = isNullEqual(month1, month2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return isSameYear(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);\n}\nexport function isSameDate(generateConfig, date1, date2) {\n var equal = isNullEqual(date1, date2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getYear(date1) === generateConfig.getYear(date2) && generateConfig.getMonth(date1) === generateConfig.getMonth(date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);\n}\nexport function isSameTime(generateConfig, time1, time2) {\n var equal = isNullEqual(time1, time2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);\n}\nexport function isSameWeek(generateConfig, locale, date1, date2) {\n var equal = isNullEqual(date1, date2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);\n}\nexport function isEqual(generateConfig, value1, value2) {\n return isSameDate(generateConfig, value1, value2) && isSameTime(generateConfig, value1, value2);\n}\n/** Between in date but not equal of date */\n\nexport function isInRange(generateConfig, startDate, endDate, current) {\n if (!startDate || !endDate || !current) {\n return false;\n }\n\n return !isSameDate(generateConfig, startDate, current) && !isSameDate(generateConfig, endDate, current) && generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);\n}\nexport function getWeekStartDate(locale, generateConfig, value) {\n var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);\n var monthStartDate = generateConfig.setDate(value, 1);\n var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);\n var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);\n\n if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) {\n alignStartDate = generateConfig.addDate(alignStartDate, -7);\n }\n\n return alignStartDate;\n}\nexport function getClosingViewDate(viewDate, picker, generateConfig) {\n var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n switch (picker) {\n case 'year':\n return generateConfig.addYear(viewDate, offset * 10);\n\n case 'quarter':\n case 'month':\n return generateConfig.addYear(viewDate, offset);\n\n default:\n return generateConfig.addMonth(viewDate, offset);\n }\n}\nexport function formatValue(value, _ref) {\n var generateConfig = _ref.generateConfig,\n locale = _ref.locale,\n format = _ref.format;\n return typeof format === 'function' ? format(value) : generateConfig.locale.format(locale.locale, value, format);\n}\nexport function parseValue(value, _ref2) {\n var generateConfig = _ref2.generateConfig,\n locale = _ref2.locale,\n formatList = _ref2.formatList;\n\n if (!value || typeof formatList[0] === 'function') {\n return null;\n }\n\n return generateConfig.locale.parse(locale.locale, value, formatList);\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/utils/dateUtil.js"],"names":["WEEK_DAY_COUNT","isNullEqual","value1","value2","undefined","isSameDecade","generateConfig","decade1","decade2","equal","num1","Math","floor","getYear","num2","isSameYear","year1","year2","getQuarter","date","quota","getMonth","isSameQuarter","quarter1","quarter2","isSameMonth","month1","month2","isSameDate","date1","date2","getDate","isSameTime","time1","time2","getHour","getMinute","getSecond","isSameWeek","locale","getWeek","isEqual","isInRange","startDate","endDate","current","isAfter","getWeekStartDate","value","weekFirstDay","getWeekFirstDay","monthStartDate","setDate","startDateWeekDay","getWeekDay","alignStartDate","addDate","getClosingViewDate","viewDate","picker","offset","arguments","length","addYear","addMonth","formatValue","_ref","format","parseValue","_ref2","formatList","parse"],"mappings":"AAAA,OAAO,IAAIA,cAAc,GAAG,CAArB;AACP,OAAO,SAASC,WAAT,CAAqBC,MAArB,EAA6BC,MAA7B,EAAqC;AAC1C,MAAI,CAACD,MAAD,IAAW,CAACC,MAAhB,EAAwB;AACtB,WAAO,IAAP;AACD;;AAED,MAAI,CAACD,MAAD,IAAW,CAACC,MAAhB,EAAwB;AACtB,WAAO,KAAP;AACD;;AAED,SAAOC,SAAP;AACD;AACD,OAAO,SAASC,YAAT,CAAsBC,cAAtB,EAAsCC,OAAtC,EAA+CC,OAA/C,EAAwD;AAC7D,MAAIC,KAAK,GAAGR,WAAW,CAACM,OAAD,EAAUC,OAAV,CAAvB;;AAEA,MAAI,OAAOC,KAAP,KAAiB,SAArB,EAAgC;AAC9B,WAAOA,KAAP;AACD;;AAED,MAAIC,IAAI,GAAGC,IAAI,CAACC,KAAL,CAAWN,cAAc,CAACO,OAAf,CAAuBN,OAAvB,IAAkC,EAA7C,CAAX;AACA,MAAIO,IAAI,GAAGH,IAAI,CAACC,KAAL,CAAWN,cAAc,CAACO,OAAf,CAAuBL,OAAvB,IA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AAAA,MAEI4B,MAAM,GAAGD,IAAI,CAACC,MAFlB;AAGA,SAAO,OAAOA,MAAP,KAAkB,UAAlB,GAA+BA,MAAM,CAACnB,KAAD,CAArC,GAA+C1C,cAAc,CAACiC,MAAf,CAAsB4B,MAAtB,CAA6B5B,MAAM,CAACA,MAApC,EAA4CS,KAA5C,EAAmDmB,MAAnD,CAAtD;AACD;AACD,OAAO,SAASC,UAAT,CAAoBpB,KAApB,EAA2BqB,KAA3B,EAAkC;AACvC,MAAI/D,cAAc,GAAG+D,KAAK,CAAC/D,cAA3B;AAAA,MACIiC,MAAM,GAAG8B,KAAK,CAAC9B,MADnB;AAAA,MAEI+B,UAAU,GAAGD,KAAK,CAACC,UAFvB;;AAIA,MAAI,CAACtB,KAAD,IAAU,OAAOsB,UAAU,CAAC,CAAD,CAAjB,KAAyB,UAAvC,EAAmD;AACjD,WAAO,IAAP;AACD;;AAED,SAAOhE,cAAc,CAACiC,MAAf,CAAsBgC,KAAtB,CAA4BhC,MAAM,CAACA,MAAnC,EAA2CS,KAA3C,EAAkDsB,UAAlD,CAAP;AACD","sourcesContent":["export var WEEK_DAY_COUNT = 7;\nexport function isNullEqual(value1, value2) {\n if (!value1 && !value2) {\n return true;\n }\n\n if (!value1 || !value2) {\n return false;\n }\n\n return undefined;\n}\nexport function isSameDecade(generateConfig, decade1, decade2) {\n var equal = isNullEqual(decade1, decade2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n var num1 = Math.floor(generateConfig.getYear(decade1) / 10);\n var num2 = Math.floor(generateConfig.getYear(decade2) / 10);\n return num1 === num2;\n}\nexport function isSameYear(generateConfig, year1, year2) {\n var equal = isNullEqual(year1, year2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getYear(year1) === generateConfig.getYear(year2);\n}\nexport function getQuarter(generateConfig, date) {\n var quota = Math.floor(generateConfig.getMonth(date) / 3);\n return quota + 1;\n}\nexport function isSameQuarter(generateConfig, quarter1, quarter2) {\n var equal = isNullEqual(quarter1, quarter2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return isSameYear(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);\n}\nexport function isSameMonth(generateConfig, month1, month2) {\n var equal = isNullEqual(month1, month2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return isSameYear(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);\n}\nexport function isSameDate(generateConfig, date1, date2) {\n var equal = isNullEqual(date1, date2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getYear(date1) === generateConfig.getYear(date2) && generateConfig.getMonth(date1) === generateConfig.getMonth(date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);\n}\nexport function isSameTime(generateConfig, time1, time2) {\n var equal = isNullEqual(time1, time2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);\n}\nexport function isSameWeek(generateConfig, locale, date1, date2) {\n var equal = isNullEqual(date1, date2);\n\n if (typeof equal === 'boolean') {\n return equal;\n }\n\n return generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);\n}\nexport function isEqual(generateConfig, value1, value2) {\n return isSameDate(generateConfig, value1, value2) && isSameTime(generateConfig, value1, value2);\n}\n/** Between in date but not equal of date */\n\nexport function isInRange(generateConfig, startDate, endDate, current) {\n if (!startDate || !endDate || !current) {\n return false;\n }\n\n return !isSameDate(generateConfig, startDate, current) && !isSameDate(generateConfig, endDate, current) && generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);\n}\nexport function getWeekStartDate(locale, generateConfig, value) {\n var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);\n var monthStartDate = generateConfig.setDate(value, 1);\n var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);\n var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);\n\n if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) {\n alignStartDate = generateConfig.addDate(alignStartDate, -7);\n }\n\n return alignStartDate;\n}\nexport function getClosingViewDate(viewDate, picker, generateConfig) {\n var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n switch (picker) {\n case 'year':\n return generateConfig.addYear(viewDate, offset * 10);\n\n case 'quarter':\n case 'month':\n return generateConfig.addYear(viewDate, offset);\n\n default:\n return generateConfig.addMonth(viewDate, offset);\n }\n}\nexport function formatValue(value, _ref) {\n var generateConfig = _ref.generateConfig,\n locale = _ref.locale,\n format = _ref.format;\n return typeof format === 'function' ? format(value) : generateConfig.locale.format(locale.locale, value, format);\n}\nexport function parseValue(value, _ref2) {\n var generateConfig = _ref2.generateConfig,\n locale = _ref2.locale,\n formatList = _ref2.formatList;\n\n if (!value || typeof formatList[0] === 'function') {\n return null;\n }\n\n return generateConfig.locale.parse(locale.locale, value, formatList);\n}"]},"metadata":{},"sourceType":"module"}