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

Ойын-сауық

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/github/samseli...
🧑‍💻 Diff from this video: github.com/samselikoff/2022-0...
✨ Tailwind UI Calendars: tailwindui.com/components/app...
📆 date-fns library: date-fns.org

Пікірлер: 86

  • @liamsmith6859
    @liamsmith68599 ай бұрын

    Sam, this is freaking awesome - thanks so much for putting this together. So cool seeing you pull this together and how you approach it.

  • @MattChinander
    @MattChinander2 жыл бұрын

    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!

  • @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!

  • @AlexSmith-sf9qr
    @AlexSmith-sf9qr2 жыл бұрын

    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

  • @ogpuzzle4382
    @ogpuzzle43822 жыл бұрын

    Another Fantastic tutorial Sam! My version came together beautifully. Thx! again.

  • @khairulhaaziq2332
    @khairulhaaziq2332 Жыл бұрын

    Best tutorial ever. Went from not knowing anything about calendars now I can make a library

  • @varsketisLT
    @varsketisLT Жыл бұрын

    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

  • @ivantotev9343
    @ivantotev9343 Жыл бұрын

    Great video, Sam ! Really helped me understand date fns !

  • @techspace5373
    @techspace5373 Жыл бұрын

    These videos are just so interesting and fun to watch!

  • @adamtak3128
    @adamtak31282 жыл бұрын

    Best dev channel. Always come out with banger content!

  • @MachetesTV
    @MachetesTV Жыл бұрын

    Thanks very much for this Video, i created a simillary calendar with angular, it was a pleasure beeing guided by you!

  • @HeyNoah
    @HeyNoah2 жыл бұрын

    Dude.. this was great!!! Thank you so much, love your vids!!!

  • @stevecastaneda
    @stevecastaneda2 жыл бұрын

    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

    Жыл бұрын

    a vote for framer animations

  • @Apparentt
    @Apparentt2 жыл бұрын

    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

  • @tutoriaisdev
    @tutoriaisdev Жыл бұрын

    Amazing video, thank you Sam!!

  • @robinvriens
    @robinvriens Жыл бұрын

    What a great explanation, everything was very clear!

  • @zacharyfreiter4445
    @zacharyfreiter444523 сағат бұрын

    Great Job! Exactly what I was looking for.

  • @yvigg
    @yvigg5 ай бұрын

    This is so cool. Thanks mate. You really saved me!

  • @nazarshvets7501
    @nazarshvets7501 Жыл бұрын

    Wow! I`m speachless. Great content 🔥🔥🔥

  • @joshuastories
    @joshuastories Жыл бұрын

    This is really cool. Thank you very very much!

  • @AlanMontgomery
    @AlanMontgomery Жыл бұрын

    Hey Sam. Beautiful tutorial!

  • @sethdavis512
    @sethdavis512 Жыл бұрын

    Great video - thanks for sharing!

  • @IamGroot701
    @IamGroot701 Жыл бұрын

    This is great! Thanks for sharing!

  • @paulikhane
    @paulikhane8 ай бұрын

    Masterfully done!!!

  • @nonsookongwu1556
    @nonsookongwu15562 ай бұрын

    Bro, you solved my problem. Thanks so much for this tutorial

  • @kwadoskii
    @kwadoskii2 жыл бұрын

    Just what I need now. Thanks

  • @bobdpa
    @bobdpa Жыл бұрын

    Wow awesome video! Thanks!

  • @joshuapadron-uy9513
    @joshuapadron-uy9513 Жыл бұрын

    Awesome Tutorial!! :D 10/10

  • @althafabbas5385
    @althafabbas53857 ай бұрын

    wow, great vdo broii, thanks

  • @xxidbr9
    @xxidbr92 жыл бұрын

    great video ✨

  • @LuksFay
    @LuksFay Жыл бұрын

    AMAZING. Seens like will be very usefull for my project, so thanks u for share this!

  • @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.

  • @vfshera
    @vfshera Жыл бұрын

    Exactly what I am looking for

  • @luckyboy3802
    @luckyboy3802 Жыл бұрын

    Excellent , thank you 👍

  • @pranavpatel2810
    @pranavpatel28102 жыл бұрын

    Thanks for this great video

  • @rhidlor8577
    @rhidlor85772 жыл бұрын

    very nice, thank you

  • @edgardsierra9261
    @edgardsierra926111 ай бұрын

    Nice video!! u have a new member

  • @alihossemedine62
    @alihossemedine62 Жыл бұрын

    great stuff

  • @sunil.b
    @sunil.b2 жыл бұрын

    Great Sir!👏

  • @kariza76record
    @kariza76record4 ай бұрын

    Awesome 🎉🎉

  • @simonswiss
    @simonswiss2 жыл бұрын

    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.

  • @avinashgardasalgonquin4371
    @avinashgardasalgonquin437111 ай бұрын

    wow amazing!

  • @alexg7282
    @alexg7282 Жыл бұрын

    Thank you!

  • @faruksardar8829
    @faruksardar88295 ай бұрын

    You are Amazing 💥🔥

  • @Tay74514
    @Tay745142 жыл бұрын

    Thank you.

  • @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?

  • @djimenezweb
    @djimenezweb9 ай бұрын

    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?

  • @sallehshah
    @sallehshah8 ай бұрын

    love your content ♥♥♥♥♥♥

  • @osman3404
    @osman34042 жыл бұрын

    Another neat video would be doing all this with remix and server side rendering: and lifting state to the route :)

  • @engelshentenawy
    @engelshentenawy Жыл бұрын

    Thanks.

  • @kobbimensah547
    @kobbimensah547 Жыл бұрын

    Wow thanks a lot

  • @arditgashi8850
    @arditgashi88502 жыл бұрын

    Most underrated youtuber! Sorry for asking again but when are you getting a community discord so we can interact with you? :D

  • @user-ej4iv4ry3w
    @user-ej4iv4ry3w4 ай бұрын

    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.

  • @salzpro
    @salzpro Жыл бұрын

    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

  • @sashaikevich
    @sashaikevich2 жыл бұрын

    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?

  • @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.

  • @julietkelechi7785
    @julietkelechi7785 Жыл бұрын

    Cool video, how do you reduce the height of the calendar?

  • @AlexandreLaguardia1
    @AlexandreLaguardia12 жыл бұрын

    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?

  • @sandrahufford8858
    @sandrahufford88582 жыл бұрын

    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

    Жыл бұрын

    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

    Жыл бұрын

    Make sure 'MMM-yyyy' is the same format as currentMonth

  • @bublikbublikovich2229
    @bublikbublikovich2229 Жыл бұрын

    which command did you use to install tailwind? i tried npm install tailwindcss@latest, but styles didn't work

  • @prashank
    @prashank2 жыл бұрын

    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.

  • @enochasandahall2034
    @enochasandahall20342 жыл бұрын

    it's really nice, especially the music in the background, can you tell me the music playlist

  • @UncleDavid
    @UncleDavid Жыл бұрын

    can i steal this for a pythononic version and turn it into work schedule thingy?

  • @FreeSkypeGenerator1
    @FreeSkypeGenerator12 жыл бұрын

    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.

  • @engelshentenawy
    @engelshentenawy2 жыл бұрын

    what shortcut do u use to collapse sections or tags ?

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    z then c to close or o to open

  • @SeanCassiere
    @SeanCassiere Жыл бұрын

    Could we get a follow-up to this?

  • @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

  • @ramnavan
    @ramnavan10 ай бұрын

    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.

  • @dreamsachiever212
    @dreamsachiever2128 күн бұрын

    WOW. That's all I got to say.

  • @SogMosee
    @SogMosee Жыл бұрын

    Make an infinitely scrolling calendar like on todoist

  • @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...

  • @eshw23
    @eshw23 Жыл бұрын

    I was loving everything until you said we have to pay hundreds of dollars for the components to follow this video.

  • @RaZziaN1
    @RaZziaN12 жыл бұрын

    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.

  • @Housni.Benabid
    @Housni.Benabid Жыл бұрын

    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

Келесі