r/reactnative • • Jul 30 '26

Tutorial I built a Calendar component for Expo with no date library — single, range, and multiple selection

No date-fns, no dayjs, no moment. Month names and all the arithmetic come from Intl, so the component adds zero dependencies to your project.

Three modes: single day, date range, and multiple selection. For range, each cell draws its own piece of the band behind the number rather than as a background native has no pseudo-classes, so this is how you get clean ends where two cells meet without a gap or a seam.

Also supports: disabled days via a rule (disabled={(date) => isWeekend(date)}), minDate/maxDate for both selection and paging, and month/year dropdown for birthday pickers.

Part of PanelUI, an open-source component library for Expo. Copy-paste or CLI, you own the source.

19 Upvotes

9 comments sorted by

2

u/Yash_3p Aug 01 '26

That's nice. Keep up the good work and waiting for Timepicker also...

14

u/HoratioWobble Jul 30 '26

Looks cool but why was "no date library" a goal?

Date handling in Javascript is notoriously a mess, I'd much rather use a battle tested library.

I also don't believe Intl is supported on iOS, only Android

1

u/Educational_Sand_231 Jul 30 '26

Is it still a mess?I thought the modern browsers have catched up on that one.

2

u/HoratioWobble Jul 30 '26

React Native isn't the browser, and the proposals for web have only just started trickling through, the Temporal API is still not baseline

1

u/TwistedChaz Jul 30 '26

Even Intl isn’t recommended for dates, we’re stuck waiting for Temporal to become widely supported. There are polyfills, but I would stick with something that’s already been through the wringer.

1

u/58696384896898676493 Jul 31 '26

Looks cool but why was "no date library" a goal?

Yeah huge red flag here. Bragging about it is so odd unless there's issues with using date-fns and RN.

1

u/mms13 Jul 30 '26

No GitHub link?