index.sjs 790 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var antmove_export = {};
  2. import antmove_1_module from './utils.sjs';
  3. /* eslint-disable */
  4. var utils = antmove_1_module;
  5. function getMonths(minDate, maxDate) {
  6. var months = [];
  7. var cursor = getDate(minDate);
  8. cursor.setDate(1);
  9. do {
  10. months.push(cursor.getTime());
  11. cursor.setMonth(cursor.getMonth() + 1);
  12. } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1);
  13. return months;
  14. }
  15. function getButtonDisabled(type, currentDate) {
  16. if (currentDate == null) {
  17. return true;
  18. }
  19. if (type === 'range') {
  20. return !currentDate[0] || !currentDate[1];
  21. }
  22. if (type === 'multiple') {
  23. return !currentDate.length;
  24. }
  25. return !currentDate;
  26. }
  27. antmove_export = {
  28. getMonths: getMonths,
  29. getButtonDisabled: getButtonDisabled
  30. };
  31. export default antmove_export;