Skip to content

custom holidays #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
srt207-reza opened this issue Feb 8, 2025 · 0 comments
Open

custom holidays #333

srt207-reza opened this issue Feb 8, 2025 · 0 comments

Comments

@srt207-reza
Copy link

با سلام و احترام
من دارم یه سرویس فراخوانی میکنم که بهم تعطیلات یک بازه 2 الی 3 ماه رو برام برمیگردونه و من میخواهم روز هایی که تطعیله توی تقویمم رنگ قرمز بگیره و همانند مثال زیر دارم از mapdays استفاده میکنم اما مشکلی که وجود داره اینکه من میخوام فقط روز های تعطیل همان ماه قرمز شود با این حال روز های ماه های آتی هم قرمز میشود.

`mapDays={({ date, today, selectedDate, isSameDate }: any) => {
let isWeekend = date.weekDay.index === 6
let isHoliday = holidays.includes(date.day)

          let config: any = {
            style: {
              color: isWeekend || isHoliday ? '#cc0303' : '',
              height: '38px',
              width: '38px'
            }
          }

          if (isSameDate(date, selectedDate[0]) || isSameDate(date, selectedDate[1])) {
            config.style = {
              ...config.style,
              color: '#fff',
            }
          }

          if (isSameDate(date, today)) config.style.color = 'green'

          return config
        }}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant