src/utils/isChineseNewYear/isChineseNewYear.js
/**
 * @function isChineseNewYear
 * @description Returns true if the date passed in is in the chinese new year.
 * @author Alexander Burdiss
 * @since 12/29/21
 * @version 1.0.0
 * @param {Date} date
 * @returns {boolean}
 */
@function isChineseNewYear
@description Returns true if the date passed in is in the chinese new year.
@function isChineseNewYear @description Returns true if the date passed in is in the chinese new year .
function isChineseNewYear(date) {
  const cal = new CalendarChinese();
  let newYear = cal.newYear(date.getFullYear());
  cal.fromJDE(newYear);
  const chineseNewYear = cal.toDate();
  for (let i = 0; i < 7; i++) {
    let tempDate = new Date(chineseNewYear);
    tempDate.setDate(tempDate.getDate() + i);
    if (
      tempDate.getMonth() == date.getMonth() &&
      tempDate.getDate() == date.getDate()
    ) {
      return true;
    }
  }
  return false;
}
function isChineseNewYear ( date ) { const cal = new CalendarChinese ( ) ; let newYear = cal . newYear ( date . getFullYear ( ) ) ; cal . fromJDE ( newYear ) ; const chineseNewYear = cal . toDate ( ) ; for ( let i = 0 ; i < 7 ; i ++ ) { let tempDate = new Date ( chineseNewYear ) ; tempDate . setDate ( tempDate . getDate ( ) + i ) ; if ( tempDate . getMonth ( ) == date . getMonth ( ) && tempDate . getDate ( ) == date . getDate ( ) ) { return true ; } } return false ; }
@function isChineseNewYear
 @description Returns true if the date passed in is in the chinese new year.
@function isChineseNewYear @description Returns true if the date passed in is in the chinese new year .
// Get Chinese Calendar Date // convert to Date // Return true for the 7 days of celebration (official holiday) // increment the date and compare today with this.