updated calendar

This commit is contained in:
2024-06-13 19:18:02 -04:00
parent 1c9144acb2
commit 2a4c85a2ff
2 changed files with 449 additions and 154 deletions
+1 -2
View File
@@ -15,7 +15,7 @@ const CalenderItemVariants = cva(
split: "bg-pink-500 border-pink-500",
},
size: {
sm: "",
sm: "whitespace-nowrap",
lg: "rounded-lg min-h-16",
},
},
@@ -27,7 +27,6 @@ const CalenderItemVariants = cva(
);
interface CalendarItemProps extends VariantProps<typeof CalenderItemVariants> {
// type: "conference" | "dividend" | "earnings" | "event" | "split";
title: string;
time?: string;
description?: string;
+446 -150
View File
@@ -2,11 +2,229 @@ import { format } from "date-fns-tz";
import React from "react";
import CalendarItem from "./CalendarItem";
import { CardContent, CardHeader, Card, CardTitle } from "../ui/card";
import { cn } from "@/lib/utils";
import {
addDays,
isToday,
lightFormat,
startOfMonth,
startOfWeek,
} from "date-fns";
const MonthCalendar = () => {
const dates = [
// {
// "date": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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": "2024-06-09T08: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-12T08:00:00.000Z",
"date": "2024-06-09T08:00:00.000Z",
"events": [
// { "title": "BABA Conference", "variant": "conference", "time": "AMC" },
// { "title": "MSFT Dividend", "variant": "dividend", "time": "BMO" },
@@ -21,9 +239,60 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-13T08:00:00.000Z",
"date": "2024-06-10T08:00:00.000Z",
"events": [
{ "title": "TSLA Event", "variant": "event", "time": "AMC" },
{ "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": "2024-06-11T08: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": "2024-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": "2024-06-13T08:00:00.000Z",
"events": [
{
"title": "TSLA Event",
"variant": "event",
"time": "9:00am",
"description":
"Tesla shareholders have reaffirmed a pay award of more than $45 billion for Elon Musk, the chief executive, after it was thrown out in a legal challenge.\nThe vote result, announced at Tesla's annual meeting at its headquarters in Austin, Texas, on Thursday, is a strong sign that shareholders still believe in Mr. Musk, and it could persuade the judge who voided the award to reinstate it.\nSupport for the pay award, made up of stock options, will come as a relief to Mr. Musk's admirers, who feared that rejection would prompt him to spend less time managing Tesla or even quit. The vote was a setback for investors who had hoped it would send a message about the accountability of chief executives and the limits of executive pay.\nThe outcome may also help Mr. Musk qualify as the world's richest person, worth well over $200 billion.\nAddressing shareholders after the vote, he promised that he was committed to Tesla. The pay package, he said, is not actually cash, and I can't cut and run, nor would I want to.\nTesla shares rose on Thursday ahead of the official announcement of the results after Mr. Musk said on X that the pay plan was passing by a wide margin.",
},
{ "title": "JPM Conference", "variant": "conference", "time": "BMO" },
{ "title": "WMT Event", "variant": "event", "time": "BMO" },
{ "title": "GOOGL Dividend", "variant": "dividend", "time": "BMO" },
@@ -33,7 +302,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-14T08:00:00.000Z",
"date": "2024-06-14T08:00:00.000Z",
"events": [
{ "title": "JPM Dividend", "variant": "dividend", "time": "BMO" },
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
@@ -43,29 +312,29 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-15T08:00:00.000Z",
"date": "2024-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" },
// { "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",
"date": "2024-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" },
// { "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",
"date": "2024-06-17T08:00:00.000Z",
"events": [
{ "title": "TSLA Conference", "variant": "conference", "time": "AMC" },
{ "title": "AMZN Earnings", "variant": "earnings", "time": "BMO" },
@@ -74,31 +343,31 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-20T08:00:00.000Z",
"date": "2024-06-18T08: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" },
{ "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",
"date": "2024-06-19T08: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" },
{ "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",
"date": "2024-06-20T08:00:00.000Z",
"events": [
{ "title": "AMZN Conference", "variant": "conference", "time": "BMO" },
{ "title": "TSLA Conference", "variant": "conference", "time": "AMC" },
@@ -113,7 +382,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-23T08:00:00.000Z",
"date": "2024-06-21T08:00:00.000Z",
"events": [
{ "title": "AAPL Event", "variant": "event", "time": "BMO" },
{ "title": "GOOGL Event", "variant": "event", "time": "AMC" },
@@ -128,33 +397,33 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-26T08:00:00.000Z",
"date": "2024-06-22T08: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" },
// { "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",
"date": "2024-06-23T08: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" },
// { "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",
"date": "2024-06-24T08:00:00.000Z",
"events": [
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "BMO" },
{ "title": "JPM Earnings", "variant": "earnings", "time": "BMO" },
@@ -166,23 +435,21 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-06-29T08:00:00.000Z",
"date": "2024-06-25T08:00:00.000Z",
"events": [{ "title": "BABA Event", "variant": "event", "time": "BMO" }],
},
{
"date": "2024-06-26T08:00:00.000Z",
"events": [
// { "title": "BABA Event", "variant": "event", "time": "BMO" }
{ "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-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",
"date": "2024-06-27T08:00:00.000Z",
"events": [
{ "title": "GOOGL Earnings", "variant": "earnings", "time": "AMC" },
{ "title": "MSFT Earnings", "variant": "earnings", "time": "AMC" },
@@ -191,7 +458,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-04T08:00:00.000Z",
"date": "2024-06-28T08:00:00.000Z",
"events": [
{ "title": "BABA Split", "variant": "split", "time": "AMC" },
{ "title": "AAPL Earnings", "variant": "earnings", "time": "AMC" },
@@ -202,26 +469,26 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-05T08:00:00.000Z",
"date": "2024-06-29T08: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" },
// { "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",
"date": "2024-06-30T08: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" },
// { "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",
"date": "2024-07-01T08:00:00.000Z",
"events": [
{ "title": "JPM Event", "variant": "event", "time": "AMC" },
{ "title": "TSLA Dividend", "variant": "dividend", "time": "AMC" },
@@ -232,7 +499,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-10T08:00:00.000Z",
"date": "2024-07-02T08:00:00.000Z",
"events": [
// { "title": "AMZN Split", "variant": "split", "time": "BMO" },
// { "title": "NVDA Dividend", "variant": "dividend", "time": "AMC" },
@@ -241,7 +508,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-11T08:00:00.000Z",
"date": "2024-07-03T08:00:00.000Z",
"events": [
// { "title": "TSLA Earnings", "variant": "earnings", "time": "BMO" },
// { "title": "AMZN Event", "variant": "event", "time": "BMO" },
@@ -256,55 +523,55 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-12T08:00:00.000Z",
"date": "2024-07-04T08: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" },
// { "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",
"date": "2024-07-05T08: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" },
// { "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",
"date": "2024-07-06T08: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" },
// { "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",
"date": "2024-07-07T08: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" },
// { "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",
"date": "2024-07-08T08: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",
"date": "2024-07-09T08:00:00.000Z",
"events": [
// { "title": "META Dividend", "variant": "dividend", "time": "AMC" },
// { "title": "GOOGL Conference", "variant": "conference", "time": "BMO" },
@@ -314,7 +581,7 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-20T08:00:00.000Z",
"date": "2024-07-10T08:00:00.000Z",
"events": [
// { "title": "GOOGL Event", "variant": "event", "time": "BMO" },
// { "title": "BABA Conference", "variant": "conference", "time": "AMC" },
@@ -325,79 +592,109 @@ const MonthCalendar = () => {
],
},
{
"date": "2023-07-21T08:00:00.000Z",
"date": "2024-07-11T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
{
"date": "2024-07-12T08: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": "2024-07-13T08: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": "2024-07-24T08: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": "2024-07-25T08: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": "2024-07-26T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
{
"date": "2023-07-26T08:00:00.000Z",
"date": "2024-07-27T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
{
"date": "2024-07-28T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
{
"date": "2024-07-29T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
{
"date": "2024-07-30T08:00:00.000Z",
"events": [
// { "title": "BABA Split", "variant": "split", "time": "AMC" }
],
},
// {
// "date": "2023-07-27T08:00:00.000Z",
// "date": "2024-07-31T08:00:00.000Z",
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
// },
// {
// "date": "2023-07-28T08:00:00.000Z",
// "date": "2024-08-01T08: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",
// "date": "2024-08-02T08:00:00.000Z",
// "events": [{ "title": "BABA Split", "variant": "split", "time": "AMC" }],
// },
];
const startDate = startOfWeek(startOfMonth(new Date("2024-09-22")));
const endDate = addDays(startDate, 41);
// console.log(startDate);
// console.log(endDate);
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">
<div className="grid grid-cols-7 grid-rows-6 h-full">
{dates.map((item, index) => (
<div
key={index}
className="border border-neutral-700 flex flex-col border-r-0 border-b-0"
className={cn(
"border border-neutral-700 flex flex-col border-r-0 border-b-0"
)}
>
<div className="p-2">
<p
className={cn(
isToday(item.date) ? "bg-red-600" : "",
"font-bold rounded-full w-6 flex justify-center"
)}
>
<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 px-2">
{item.events.length < 5
</div>
<div className="grid grid-rows-4 overflow-hidden gap-1 p-1 px-2">
{item.events.length < 4
? item.events.map((event: any, eventkey: number) => (
<CalendarItem
time={event.time}
@@ -409,7 +706,7 @@ const MonthCalendar = () => {
))
: [
...item.events
.slice(0, 4)
.slice(0, 3)
.map((event: any, eventkey: number) => (
<CalendarItem
time={event.time}
@@ -420,7 +717,7 @@ const MonthCalendar = () => {
/>
)),
<CalendarItem
title={`+ ${item.events.length - 4} more`}
title={`+ ${item.events.length - 3} more`}
key="end"
size="sm"
/>,
@@ -431,7 +728,6 @@ const MonthCalendar = () => {
</div>
</CardContent>
</Card>
// </div>
);
};