0

I am trying to make a calendar using nextjs. I use https://ant.design/components/calendar/#API.

My issue is how to highlight all holidays of a year and month?

I tried like this https://codesandbox.io/s/react-big-calendar-custom-year-view-forked-nz6g3?file=/src/Antd.jsx

In this Example "2021-09-01" is hard coded. I want to show dynamically holiday_date

const data = {
  "2021-09-01": [
    {
      content: "text content",
      poi: "poi객체가 들어오겠지",
      date: new Date("2021-09-01 20:32:12"),
      photos: []
    },
  ]
}

I have holiday_date (I mapped and get from below data). I tried with this code. But I didn't get highlighted date.

  const data = {
    holiday_date: [
      {
        content: holiday_name,
        date: holiday_date,
        photos: [],
      },
    ],
  };

console.log(holiday_date) logged in console like 2021-12-08 ( Like this I have more date of Holidays).

And I mapped and get holiday_Date as a string data Type.

Why I can not use holiday_type instead of this "2021-09-01"?. How to Highlight holidays dynamically in https://ant.design/components/calendar/#API ?

juliomalves
  • 21,997
  • 12
  • 75
  • 81
hanu
  • 43
  • 6

0 Answers0