debug_lunar.js 503 B

123456789101112131415161718
  1. const chineseDays = require("./dist/index.min.js");
  2. const { getLunarDate, getYearLeapMonth } = chineseDays;
  3. console.log("Lunar for 2028-05-26:", JSON.stringify(getLunarDate("2028-05-26")));
  4. const START = 1900;
  5. const END = 2100;
  6. const yearsWith30DayLeap = [];
  7. for (let year = START; year <= END; year++) {
  8. const { leapMonth, days } = getYearLeapMonth(year);
  9. if (leapMonth && days === 30) {
  10. yearsWith30DayLeap.push(year);
  11. }
  12. }
  13. console.log('闰月为30天的年份:', yearsWith30DayLeap);