utils.sjs 612 B

123456789101112131415161718192021222324252627
  1. var antmove_export = {};
  2. /* eslint-disable */
  3. function getMonthEndDay(year, month) {
  4. return 32 - getDate(year, month - 1, 32).getDate();
  5. }
  6. function compareMonth(date1, date2) {
  7. date1 = getDate(date1);
  8. date2 = getDate(date2);
  9. var year1 = date1.getFullYear();
  10. var year2 = date2.getFullYear();
  11. var month1 = date1.getMonth();
  12. var month2 = date2.getMonth();
  13. if (year1 === year2) {
  14. return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
  15. }
  16. return year1 > year2 ? 1 : -1;
  17. }
  18. antmove_export = {
  19. getMonthEndDay: getMonthEndDay,
  20. compareMonth: compareMonth
  21. };
  22. export default antmove_export;