JSFiddle - React, Tailwind, and code Playground

by saitam

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-business-days/1.2.0/index.js"></script>

JavaScript

myHolidays = [
  { holidayDate: "2020-06-01", description: "holiday 1" },
  { holidayDate: "2020-06-02", description: "holiday 2" },
  { holidayDate: "2020-06-03", description: "holiday 3" },  
  { holidayDate: "2020-06-04", description: "holiday 4" },
  { holidayDate: "2020-06-05", description: "holiday 5" },
  { holidayDate: "2020-06-11", description: "holiday 6" },
  { holidayDate: "2020-06-13", description: "" },
  { holidayDate: "2020-06-14", description: "" },
  { holidayDate: "2020-06-20", description: "" },
  { holidayDate: "2020-06-21", description: "" },
  { holidayDate: "2020-06-27", description: "" },
  { holidayDate: "2020-06-28", description: "" },
  { holidayDate: "2020-07-04", description: "" },
  { holidayDate: "2020-07-05", description: "" },
  { holidayDate: "2020-07-11", description: "" },
  { holidayDate: "2020-07-12", description: "" },
  { holidayDate: "2020-07-18", description: "" },
  { holidayDate: "2020-07-19", description: "" },
  { holidayDate: "2020-07-25", description: "" },
  { holidayDate: "2020-07-26", description: "" },
  { holidayDate: "2020-08-01", description: "" },
  { holidayDate: "2020-08-02", description: "" },
  { holidayDate: "2020-08-08", description: "" },
  { holidayDate: "2020-08-09", description: "" },
  { holidayDate: "2020-08-15", description: "" },
  { holidayDate: "2020-08-16", description: "" },
  { holidayDate: "2020-08-22", description: "" },
  { holidayDate: "2020-08-23", description: "" },
  { holidayDate: "2020-08-29", description: "" },
  { holidayDate: "2020-08-30", description: "" }
];

moment.updateLocale('de', {
   holidays: myHolidays.map(i => i.holidayDate),
   holidayFormat: 'YYYY-MM-DD'
});

var startDate = moment("2020-01-01")
var endDate = moment("2020-12-01")
var eachMonthWith16 = [];

function generate16InEachMonth() {
  let monthsList = []
  // loop by months
  while (endDate > startDate) {
  	monthsList.push(new Date(moment(this.startDate).businessAdd(15, 'days')))
    startDate =...