code-big-calendar
dedevs-ui/code-big-calendarFreeComponent
Big calendar component for displaying events
See it running
Open the demo on dedevs-ui
ui.dedevs.com/components/code-big-calendarInstall it
npx shadcn@latest add https://ui.dedevs.com/r/code-big-calendar.jsonSource
1"use client";23import { useState, useMemo } from "react";4import { addDays, setHours, setMinutes, getDay } from "date-fns";5import { useCalendarContext } from "./event-calendar/calendar-context";67import {8 EventCalendar,9 type CalendarEvent,10 type EventColor,11} from "./event-calendar";1213// Etiquettes data for calendar filtering14export const etiquettes = [15 {16 id: "my-events",17 name: "My Events",18 color: "emerald" as EventColor,19 isActive: true,20 },21 {22 id: "marketing-team",23 name: "Marketing Team",24 color: "orange" as EventColor,25 isActive: true,26 },27 {28 id: "interviews",29 name: "Interviews",30 color: "violet" as EventColor,31 isActive: true,32 },33 {34 id: "events-planning",35 name: "Events Planning",36 color: "blue" as EventColor,37 isActive: true,38 },39 {40 id: "holidays",41 name: "Holidays",42 color: "rose" as EventColor,43 isActive: true,44 },45];4647// Function to calculate days until next Sunday48const getDaysUntilNextSunday = (date: Date) => {49 const day = getDay(date); // 0 is Sunday, 6 is Saturday50 return day === 0 ? 0 : 7 - day; // If today is Sunday, return 0, otherwise calculate days until Sunday51};5253// Store the current date to avoid repeated new Date() calls54const currentDate = new Date();5556// Calculate the offset once to avoid repeated calculations57const daysUntilNextSunday = getDaysUntilNextSunday(currentDate);5859// Sample events data with hardcoded times60const sampleEvents: CalendarEvent[] = [61 {62 id: "w1-0a",63 title: "Executive Board Meeting",64 description: "Quarterly review with executive team",65 start: setMinutes(66 setHours(addDays(currentDate, -13 + daysUntilNextSunday), 9),67 0,68 ),69 end: setMinutes(70 setHours(addDays(currentDate, -13 + daysUntilNextSunday), 11),71 30,72 ),73 color: "blue",74 location: "Executive Boardroom",75 },76 {77 id: "w1-0b",78 title: "Investor Call",79 description: "Update investors on company progress",80 start: setMinutes(81 setHours(addDays(currentDate, -13 + daysUntilNextSunday), 14),82 0,83 ),84 end: setMinutes(85 setHours(addDays(currentDate, -13 + daysUntilNextSunday), 15),86 0,87 ),88 color: "violet",89 location: "Conference Room A",90// … truncated
Files it writes
More from dedevs-ui
All 30 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-branchai-branch | dedevs-ui | Components | Free | no deps | |
| ai-conversationai-conversation | dedevs-ui | Components | Free | no deps | |
| ai-inputai-input | dedevs-ui | Components | Free | no deps | |
| ai-messageai-message | dedevs-ui | Components | Free | no deps | |
| ai-reasoningai-reasoning | dedevs-ui | Components | Free | no deps | |
| ai-responseai-response | dedevs-ui | Components | Free | no deps | |
| ai-serverai-server | dedevs-ui | Components | Free | no deps | |
| ai-simpleai-simple | dedevs-ui | Components | Free | no deps |
