mirror of
https://github.com/dylanbenzi/yellowbird.git
synced 2026-11-27 09:17:00 +00:00
grid calendar and day calendar
This commit is contained in:
@@ -0,0 +1,434 @@
|
||||
import { format } from "date-fns-tz";
|
||||
import React from "react";
|
||||
import CalendarItem from "./CalendarItem";
|
||||
import { CardContent, CardHeader, Card, CardTitle } from "../ui/card";
|
||||
|
||||
const MonthCalendar = () => {
|
||||
const dates = [
|
||||
{
|
||||
"date": "2023-06-12T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "MSFT Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "MSFT Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "BABA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "WMT Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "AMZN Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-13T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "TSLA Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "JPM Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "WMT Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "META Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-14T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "JPM Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AAPL Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "META Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "AMZN Conference", "variant": "conference", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-15T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "JPM Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "BABA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "BABA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "AMZN Split", "variant": "split", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-16T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AMZN Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "JPM Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "MSFT Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "META Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "AMZN Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "WMT Split", "variant": "split", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-19T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "AMZN Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "MSFT Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-20T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AAPL Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "WMT Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "TSLA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "TSLA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-21T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "WMT Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "NVDA Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "AMZN Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "NVDA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "JPM Split", "variant": "split", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-22T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AMZN Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "WMT Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "WMT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "JPM Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "BABA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "BABA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "JPM Event", "variant": "event", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-23T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AAPL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "NVDA Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "TSLA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "AMZN Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "AAPL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "NVDA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "AMZN Event", "variant": "event", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-26T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "JPM Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "TSLA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "GOOGL Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "NVDA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "NVDA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "NVDA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-27T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "BABA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "META Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "META Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "GOOGL Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "BABA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-28T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "JPM Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AMZN Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "AAPL Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "META Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "JPM Earnings", "variant": "earnings", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-29T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Event", "variant": "event", "time": "BMO" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-06-30T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AAPL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AAPL Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "META Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "TSLA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "META Event", "variant": "event", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-03T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "MSFT Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "TSLA Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "MSFT Dividend", "variant": "dividend", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-04T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "BABA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "AAPL Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "AAPL Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "JPM Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "TSLA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "AAPL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-05T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "NVDA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "NVDA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-06T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "NVDA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "BABA Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "MSFT Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "WMT Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "MSFT Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-07T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "JPM Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "TSLA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "TSLA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "NVDA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-10T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "AMZN Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "NVDA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-11T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "TSLA Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AMZN Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "BMO" },
|
||||
{ "title": "WMT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "JPM Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "NVDA Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "AMZN Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "AAPL Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "AMZN Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "TSLA Earnings", "variant": "earnings", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-12T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "JPM Event", "variant": "event", "time": "AMC" },
|
||||
{ "title": "TSLA Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "NVDA Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "TSLA Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "AMC" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-13T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "JPM Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "MSFT Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "AMZN Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "NVDA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "JPM Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "MSFT Dividend", "variant": "dividend", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-14T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "TSLA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "BABA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "AMZN Earnings", "variant": "earnings", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-17T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "BABA Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "MSFT Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "MSFT Earnings", "variant": "earnings", "time": "BMO" },
|
||||
{ "title": "NVDA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "BABA Split", "variant": "split", "time": "AMC" },
|
||||
{ "title": "AAPL Dividend", "variant": "dividend", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-18T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "AAPL Event", "variant": "event", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-19T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "META Dividend", "variant": "dividend", "time": "AMC" },
|
||||
{ "title": "GOOGL Conference", "variant": "conference", "time": "BMO" },
|
||||
{ "title": "WMT Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "MSFT Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "AMZN Dividend", "variant": "dividend", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-20T08:00:00.000Z",
|
||||
"events": [
|
||||
{ "title": "GOOGL Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "BABA Conference", "variant": "conference", "time": "AMC" },
|
||||
{ "title": "META Earnings", "variant": "earnings", "time": "AMC" },
|
||||
{ "title": "TSLA Event", "variant": "event", "time": "BMO" },
|
||||
{ "title": "WMT Split", "variant": "split", "time": "BMO" },
|
||||
{ "title": "AAPL Earnings", "variant": "earnings", "time": "BMO" },
|
||||
],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-21T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-22T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-23T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-24T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-25T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
{
|
||||
"date": "2023-07-26T08:00:00.000Z",
|
||||
"events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
},
|
||||
// {
|
||||
// "date": "2023-07-27T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-07-28T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-07-29T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-07-30T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-07-31T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-08-01T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
// {
|
||||
// "date": "2023-08-02T08:00:00.000Z",
|
||||
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
|
||||
// },
|
||||
];
|
||||
|
||||
return (
|
||||
// <div className="w-full h-full border border-neutral-700 rounded-lg bg-card overflow-hidden">
|
||||
<Card className="w-full overflow-hidden">
|
||||
<CardHeader className="p-4">
|
||||
<CardTitle>June 2024</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<div className="grid grid-cols-7 grid-rows-5 h-full">
|
||||
{dates.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="border border-neutral-700 flex flex-col"
|
||||
>
|
||||
<p className="font-bold p-2">
|
||||
{format(item.date, "d", { timeZone: "America/New_York" })}
|
||||
</p>
|
||||
<div className="grid grid-rows-5 overflow-hidden gap-1 p-1">
|
||||
{item.events.length < 5
|
||||
? item.events.map((event: any, eventkey: number) => (
|
||||
<CalendarItem
|
||||
time={event.time}
|
||||
variant={event.variant}
|
||||
title={event.title}
|
||||
key={eventkey}
|
||||
size="sm"
|
||||
/>
|
||||
))
|
||||
: [
|
||||
...item.events
|
||||
.slice(0, 4)
|
||||
.map((event: any, eventkey: number) => (
|
||||
<CalendarItem
|
||||
time={event.time}
|
||||
variant={event.variant}
|
||||
title={event.title}
|
||||
key={eventkey}
|
||||
size="sm"
|
||||
/>
|
||||
)),
|
||||
<CalendarItem
|
||||
title={`+ ${item.events.length - 4} more`}
|
||||
key="end"
|
||||
size="sm"
|
||||
/>,
|
||||
]}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
// </div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MonthCalendar;
|
||||
Reference in New Issue
Block a user