Skip to content
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

Calendar collection view #369

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

MichaelCasaDev
Copy link
Contributor

@MichaelCasaDev MichaelCasaDev commented Sep 8, 2022

New Features

  • Sun-Sat or Mon-Sun week view
  • Show or hide calendar controls (showCalendarControls: boolean)
  • Decide to start the weeks on Monday or Sunday (startWeekOnMonday: boolean )
  • Automatic query from Notion's calendar collection
  • Automatic full-width for database pages with calendar collection views

Description

Adding full support to the Notion calendar collection view, which lacks support in react-notion-x

Notion Test Page ID

Page with a calendar view component

- Added calendar view to Collection view exports
- Base calendar, CSS inline from Notion
- Pages render in the correct days
- Sun-Sat week view
@vercel
Copy link

vercel bot commented Sep 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2023 4:41pm
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2023 4:41pm

- New custom Collection card for the calendar view
- Show correctly the month
Improved card title, now more like the Notion one
- Now calendar controls (next month, prev month and today) works
- Correctly mark current month day numbers
- Display the current month correctly (top left)
- Display the month in the calendar view in the first day of each month
- Show full month in every view
- Edit text component to show long months names
- New method "getPagePropertyFromId" to retrive a page property by a given property ID, used to get the query date used by Notion calendar's view
New property for the renderer "showCalendarControls" to show or not the calendar controls (next month, prev month, today)˙
TODO: add calendar dark mode theme
- Added dark-mode css for the new calendar view
- Updated background of dark-mode to the new Notion one
- Moved hover states from React to CSS
- Removed all dynamic styles and used with classes
@vercel
Copy link

vercel bot commented Sep 11, 2022

Deployment failed with the following error:

The most recent charge for your active payment method has failed. Please update it here: https://vercel.com/teams/saasify/settings/billing.

Fix linked calendars db errors
Removed unused class
Full width for full page collection view
- Added the ability to start weeks on Monday via `startWeekOnMonday`
- Made proper icons components for calendar controls
@MichaelCasaDev MichaelCasaDev changed the title WIP: Calendar collection view Calendar collection view Sep 23, 2022
@MichaelCasaDev MichaelCasaDev marked this pull request as ready for review September 23, 2022 14:11
@MichaelCasaDev
Copy link
Contributor Author

MichaelCasaDev commented Sep 23, 2022

@transitive-bullshit @normdoow

Everything on my to-do list is checked, and ready for PR review!
With this PR, calendar collection view is fully integrated into react-notion-x.

@MichaelCasaDev
Copy link
Contributor Author

MichaelCasaDev commented Feb 3, 2023

Hey @transitive-bullshit and @normdoow I have been away for a long time from this repo and from this PR but I'm happy to say that I have made some new commits that fix your reviews and also set some features:

  • Now support all types of page icons
  • Can have multiple blocks per day
  • New method to generate weeks in month (simpler and faster)

Edit: It doesn't currently support date range and include time functions of Notion, it wouldn't render the page block or the displayed data will be something strange.

The today date indicator now check also the correct now year
@kantorcodes
Copy link

Is there anything outstanding to merge this one in?

- More comments
- Fixed first day of month red background circle to not show the month name (it's shown up in the calendar controls)

WIP: The October 2023 has a strange bug (probably in the algo) that shows the 1st October as Saturday and not Sunday (only on the view that has Sunday as first week day (by using `startWeekOnMonday` it doesn't appear))
@MichaelCasaDev
Copy link
Contributor Author

Is there anything outstanding to merge this one in?

Hey @kantorcodes thanks for commenting, I've to say that I've let this PR open and didn't actually take care of.
The calendar view is one of the most complex that Notion has, and for the moment it's working very well on my test deployment. I will let this be reviewed in some weeks (at the moment it doesn't support all the features that it has on Notion or on Super.so but it's working quite well)

More infos about the calendar view and what it can handle and what it can't
@kantorcodes
Copy link

Is there anything outstanding to merge this one in?

Hey @kantorcodes thanks for commenting, I've to say that I've let this PR open and didn't actually take care of. The calendar view is one of the most complex that Notion has, and for the moment it's working very well on my test deployment. I will let this be reviewed in some weeks (at the moment it doesn't support all the features that it has on Notion or on Super.so but it's working quite well)

Thanks @MichaelCasaDev it'll be suburb to have this added in :)

@kantorcodes
Copy link

cc @transitive-bullshit

@kantorcodes
Copy link

Hey @transitive-bullshit would love to see this one approved! :)

@jigs1996
Copy link

Hey @transitive-bullshit Could you pelase merge this one this is the 1 which remain from notion block

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

Successfully merging this pull request may close these issues.

None yet

5 participants