Building an Interactive Calendar with Tailwind UI, React and date-fns

  Рет қаралды 112,043

Sam Selikoff

Sam Selikoff

Күн бұрын

Let's take a predesigned calendar from Tailwind UI and make it functional using React and the fantastic date-fns library!
💻 Calendar demo: stackblitz.com...
🧑‍💻 Diff from this video: github.com/sam...
✨ Tailwind UI Calendars: tailwindui.com...
📆 date-fns library: date-fns.org

Пікірлер: 86
@waldolavaut2800
@waldolavaut2800 Жыл бұрын
This is a master class!! I still can't believe I was looking for this exact implementation of how to do this with TailwindUI, date-fns, and React, and I'm so lucky to find this awesome video!! You're the man!
@stevecastaneda
@stevecastaneda 2 жыл бұрын
I've been meaning to migate from momentjs, and you just got me excited about date-fns. Love the integration with the new TailwindUI calendar example too. Would love to see a follow up video with the framer animations. 🙏
@sanketss84
@sanketss84 2 жыл бұрын
a vote for framer animations
@liamsmith6859
@liamsmith6859 11 ай бұрын
Sam, this is freaking awesome - thanks so much for putting this together. So cool seeing you pull this together and how you approach it.
@Apparentt
@Apparentt 2 жыл бұрын
Think you hit it on the head when you said after using date fns for a while you could kinda just “guess” the API - that’s the sign of a fantastic library
@MattChinander
@MattChinander 2 жыл бұрын
This is great, Sam. Thank you for posting this video. I have a Tailwind-backed project coming up where I've wanted to replace a calendar library with Tailwind and date-fns, and you've done the work for me!
@MachetesTV
@MachetesTV Жыл бұрын
Thanks very much for this Video, i created a simillary calendar with angular, it was a pleasure beeing guided by you!
@simonswiss
@simonswiss 2 жыл бұрын
I may be missing something, but I _think_ that using `startOfWeek(firstDayOfMonth)` works well for the start of the days range for a given month - lets you skip calculating the grid col-start offset based on what weekday the month starts on. That's how I've done it a few days ago, and it seems to work quite well. I start my weeks on Monday, so I have this: ``` const daysOfTheMonth = eachDayOfInterval({ start: startOfWeek(firstDayOfMonth, { weekStartsOn: 1 }), end: endOfWeek(endOfMonth(firstDayOfMonth), { weekStartsOn: 1 }), }) ```
@simonswiss
@simonswiss 2 жыл бұрын
Heh, of course 1 minute after writing this comment I see you show that exact thing 😅 Awesome video man.
@adamtak3128
@adamtak3128 2 жыл бұрын
Best dev channel. Always come out with banger content!
@khairulhaaziq2332
@khairulhaaziq2332 Жыл бұрын
Best tutorial ever. Went from not knowing anything about calendars now I can make a library
@AlexSmith-sf9qr
@AlexSmith-sf9qr 2 жыл бұрын
Loving these focused videos, nice work!
@saurabhdaswant7833
@saurabhdaswant7833 Жыл бұрын
man! just 10 min into the video and loved the way you teach and how date-fns beautifully works like a magic
@ShrinidhiShamasunder
@ShrinidhiShamasunder 6 ай бұрын
Great video Sam. What calendar backend or server are you using? Hopefully it has APIs that I can call from my React app to actually persist the events.
@sashaikevich
@sashaikevich 2 жыл бұрын
How do you decide on the library to use? For eg why date-fns and not moments or dayjs or spend half a day looking for some other lightweight performant library?
@HeyNoah
@HeyNoah 2 жыл бұрын
Dude.. this was great!!! Thank you so much, love your vids!!!
@varsketisLT
@varsketisLT 2 жыл бұрын
just used it in my first ever full-stack project! Will try to improve and tweak it a a bit, but still, thank you so much! Subbed
@ogpuzzle4382
@ogpuzzle4382 2 жыл бұрын
Another Fantastic tutorial Sam! My version came together beautifully. Thx! again.
@nonsookongwu1556
@nonsookongwu1556 4 ай бұрын
Bro, you solved my problem. Thanks so much for this tutorial
@FreeSkypeGenerator1
@FreeSkypeGenerator1 2 жыл бұрын
m very new to tail wind css, i have a question do you use it everysingle time or only for selective projects? Thanks
@samselikoff
@samselikoff 2 жыл бұрын
I use it on every project! And try to get every team we consult with to switch to it if they're not using it already :)
@FreeSkypeGenerator1
@FreeSkypeGenerator1 2 жыл бұрын
@@samselikoff ah thanks for clearing the confusion ! for some weird reason youtube didnt notify me about your reply.
@zacharyfreiter4445
@zacharyfreiter4445 2 ай бұрын
Great Job! Exactly what I was looking for.
@techspace5373
@techspace5373 Жыл бұрын
These videos are just so interesting and fun to watch!
@bublikbublikovich2229
@bublikbublikovich2229 Жыл бұрын
which command did you use to install tailwind? i tried npm install tailwindcss@latest, but styles didn't work
@ivantotev9343
@ivantotev9343 2 жыл бұрын
Great video, Sam ! Really helped me understand date fns !
@garyg3327
@garyg3327 Жыл бұрын
I remember about 9 years ago when I started working professionally, I was stunned my work mate was paying for a components library. These UI components are still paid for for premium ones.
@yvigg
@yvigg 7 ай бұрын
This is so cool. Thanks mate. You really saved me!
@sandrahufford8858
@sandrahufford8858 2 жыл бұрын
This is the help I've been looking for! Thanks for concise coding. However, trying to convert it to Vue composition API and I got stuck at let firstDayCurrentMonth = parse(currentMonth, 'MMM-yyyy', new Date()) I keep getting invalid date. Any suggestions?
@dev-mantas
@dev-mantas 2 жыл бұрын
This is telling date-fns how the date is read, for example if you are displaying your date as Oct, 2022 it should be firstDayCurrentMonth = parse(currentMonth, 'MMM, yyyy', new Date())
@dev-mantas
@dev-mantas 2 жыл бұрын
Make sure 'MMM-yyyy' is the same format as currentMonth
@robinvriens
@robinvriens Жыл бұрын
What a great explanation, everything was very clear!
@AlanMontgomery
@AlanMontgomery 2 жыл бұрын
Hey Sam. Beautiful tutorial!
@nazarshvets7501
@nazarshvets7501 Жыл бұрын
Wow! I`m speachless. Great content 🔥🔥🔥
@salzpro
@salzpro 2 жыл бұрын
Thank you for very useful understandable learning Video, Sam! Would it be possible to extend functionality like: 1) to show 2 months and 2 buttons (next, prev) will switch also 2 months. 2) possibility to select a date range
@tutoriaisdev
@tutoriaisdev Жыл бұрын
Amazing video, thank you Sam!!
@AlexandreLaguardia1
@AlexandreLaguardia1 2 жыл бұрын
What if I want to select a period of days? For example, I want to see all meeting from May 22 until May 29, how would I do that?
@joshuastories
@joshuastories Жыл бұрын
This is really cool. Thank you very very much!
@UncleDavid
@UncleDavid Жыл бұрын
can i steal this for a pythononic version and turn it into work schedule thingy?
@arditgashi8850
@arditgashi8850 2 жыл бұрын
Most underrated youtuber! Sorry for asking again but when are you getting a community discord so we can interact with you? :D
@djimenezweb
@djimenezweb Жыл бұрын
Loved it, thank you Sam! I wonder if it could be refactored to Styled Components. I've tried to refactor the button styles, but there are too many conditions to check. Any ideas?
@raskolnikov1873
@raskolnikov1873 Жыл бұрын
This was great! What do I do if I want to show all the events that are scheduled for the month instead of just the selected day? I can't get that to work.
@LuksFay
@LuksFay Жыл бұрын
AMAZING. Seens like will be very usefull for my project, so thanks u for share this!
@treforcoster3377
@treforcoster3377 Жыл бұрын
Love this video. I have a question though how would you deal with two events at the same time on a css grid calendar?
@prashank
@prashank 2 жыл бұрын
What a coincidence, I was working on a renderless calendar but for vue just a week ago. I did all the date calculations with js date objects, that sucked. Would have used date-fns if i knew about it, most of date library are bloated with spotty tree shaking.
@IamGroot701
@IamGroot701 Жыл бұрын
This is great! Thanks for sharing!
@paulikhane
@paulikhane 10 ай бұрын
Masterfully done!!!
@sethdavis512
@sethdavis512 2 жыл бұрын
Great video - thanks for sharing!
@kwadoskii
@kwadoskii 2 жыл бұрын
Just what I need now. Thanks
@vfshera
@vfshera Жыл бұрын
Exactly what I am looking for
@rhidlor8577
@rhidlor8577 2 жыл бұрын
very nice, thank you
@osman3404
@osman3404 2 жыл бұрын
Another neat video would be doing all this with remix and server side rendering: and lifting state to the route :)
@enochasandahall2034
@enochasandahall2034 2 жыл бұрын
it's really nice, especially the music in the background, can you tell me the music playlist
@ramnavan
@ramnavan Жыл бұрын
Probably isSameDay should be used instead of isEqual? isEqual compares time compoent as well which caused problems when UTC and local are in different dates.
@julietkelechi7785
@julietkelechi7785 Жыл бұрын
Cool video, how do you reduce the height of the calendar?
@edgardsierra9261
@edgardsierra9261 Жыл бұрын
Nice video!! u have a new member
@joshuapadron-uy9513
@joshuapadron-uy9513 Жыл бұрын
Awesome Tutorial!! :D 10/10
@bobdpa
@bobdpa Жыл бұрын
Wow awesome video! Thanks!
@engelshentenawy
@engelshentenawy 2 жыл бұрын
what shortcut do u use to collapse sections or tags ?
@samselikoff
@samselikoff 2 жыл бұрын
z then c to close or o to open
@luckyboy3802
@luckyboy3802 Жыл бұрын
Excellent , thank you 👍
@faruksardar8829
@faruksardar8829 8 ай бұрын
You are Amazing 💥🔥
@althafabbas5385
@althafabbas5385 10 ай бұрын
wow, great vdo broii, thanks
@kariza76record
@kariza76record 7 ай бұрын
Awesome 🎉🎉
@engelshentenawy
@engelshentenawy Жыл бұрын
Thanks.
@pranavpatel2810
@pranavpatel2810 2 жыл бұрын
Thanks for this great video
@SeanCassiere
@SeanCassiere 2 жыл бұрын
Could we get a follow-up to this?
@alexg7282
@alexg7282 Жыл бұрын
Thank you!
@sunil.b
@sunil.b 2 жыл бұрын
Great Sir!👏
@xxidbr9
@xxidbr9 2 жыл бұрын
great video ✨
@Tay74514
@Tay74514 2 жыл бұрын
Thank you.
@avinashgardasalgonquin4371
@avinashgardasalgonquin4371 Жыл бұрын
wow amazing!
@alihossemedine62
@alihossemedine62 Жыл бұрын
great stuff
@wfl-junior
@wfl-junior Жыл бұрын
Do you have a video for the animated version?
@samselikoff
@samselikoff Жыл бұрын
Yes, it's actually part of the course I launched! buildui.com/series/framer-motion-recipes/calendar
@SogMosee
@SogMosee Жыл бұрын
Make an infinitely scrolling calendar like on todoist
@sallehshah
@sallehshah 11 ай бұрын
love your content ♥♥♥♥♥♥
@kobbimensah547
@kobbimensah547 Жыл бұрын
Wow thanks a lot
@jimshtepa5423
@jimshtepa5423 Жыл бұрын
why is May 1 falls on Sunday when it should be on Monday in 2023? when I repeat what Sam did in this video I get May 1 on Monday and that is how it is in real calendar
@samselikoff
@samselikoff Жыл бұрын
Sounds like a time zone issue...
@dreamsachiever212
@dreamsachiever212 2 ай бұрын
WOW. That's all I got to say.
@eshw23
@eshw23 Жыл бұрын
I was loving everything until you said we have to pay hundreds of dollars for the components to follow this video.
@RaZziaN1
@RaZziaN1 2 жыл бұрын
I don't like it, you could build it from scratch, vanilla js have everything you need to achieve this, that's not really programming..
@SamedGaming
@SamedGaming 2 жыл бұрын
I hope you are being sarcastic, since this is built from scratch
@RaZziaN1
@RaZziaN1 Жыл бұрын
@@SamedGaming Vanilla is when you don't use external library. He's using date-fns.
@hb-707
@hb-707 2 жыл бұрын
This is amazing brother. I suggest to you the following. Instead of refactoring the tailwind UI components with the date-fns conditions. I think better to map the returned array from eachDayOfInterval to make it look the same as the given JSON object from tailwind. example : hosnyben.me/date-fns.png
How to build an Animated Slider with Framer Motion
31:17
Sam Selikoff
Рет қаралды 13 М.
Avoid premature abstraction with Unstyled Components
17:23
Sam Selikoff
Рет қаралды 11 М.
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 19 МЛН
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 22 МЛН
Win This Dodgeball Game or DIE…
00:36
Alan Chikin Chow
Рет қаралды 30 МЛН
10 Tailwind Tricks You NEED To Know!
10:45
Ravi - Perfect Base
Рет қаралды 293 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 650 М.
Why you should lift component state up to the URL
34:27
Sam Selikoff
Рет қаралды 28 М.
How to build a Recursive React Component
21:16
Sam Selikoff
Рет қаралды 49 М.
6 ideas for animating your app with Framer Motion
7:55
Sam Selikoff
Рет қаралды 107 М.
programming projects that taught me how to code
9:49
isak
Рет қаралды 293 М.
React Native vs Flutter - Which should you use?
22:31
Simon Grimm
Рет қаралды 32 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 19 МЛН