I've spent some time to see if I could create a basic calendar component. What I have so far can be seen here:
https://mooncake-react-date-time-picker-demo.netlify.com/
It's heavily inspired by Calendly 😅. I tried my best to reproduce a clean design, but my main goal was/is to create a functional date/time picker that looks decent enough. I think we should have someone with good design skills have a look at it, but for now I think it's good enough.
In terms of functionality, you can now only browse months and click on a day, which logs the date to the console.
This is currently the "first step". The "second step" should be picking a time slot (with support for timezones etc.).
This should be an npm module at some point, but currently it's not. You can run it locally with npm start which uses Parcel to build a simple (demo) app. This is also used for the Netlify demo page.
The <DateTimePicker /> component doesn't accept any props at the moment. We should discuss the API, but I think there's at least passing a currentDate (i.e. to render the proper date in the picker) and a validator (i.e. to determine which days can be interacted with, e.g. to disable past dates).
Additionally we should think about the best way to "get" the selected date/time data from this component, to be used in any parent. This could be as simple as passing some sort of setData function prop, but other patterns are possible as well.
But we can create issues for the stuff I mentioned and any other things as we work on/discuss it.
I've spent some time to see if I could create a basic calendar component. What I have so far can be seen here:
https://mooncake-react-date-time-picker-demo.netlify.com/
It's heavily inspired by Calendly 😅. I tried my best to reproduce a clean design, but my main goal was/is to create a functional date/time picker that looks decent enough. I think we should have someone with good design skills have a look at it, but for now I think it's good enough.
In terms of functionality, you can now only browse months and click on a day, which logs the date to the console.
This is currently the "first step". The "second step" should be picking a time slot (with support for timezones etc.).
This should be an npm module at some point, but currently it's not. You can run it locally with
npm startwhich uses Parcel to build a simple (demo) app. This is also used for the Netlify demo page.The
<DateTimePicker />component doesn't accept any props at the moment. We should discuss the API, but I think there's at least passing acurrentDate(i.e. to render the proper date in the picker) and avalidator(i.e. to determine which days can be interacted with, e.g. to disable past dates).Additionally we should think about the best way to "get" the selected date/time data from this component, to be used in any parent. This could be as simple as passing some sort of
setDatafunction prop, but other patterns are possible as well.But we can create issues for the stuff I mentioned and any other things as we work on/discuss it.