-
Notifications
You must be signed in to change notification settings - Fork 22
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
Create a basic "MVP" to discuss the functionality and design #1
Comments
I obviously also have to document a lot of stuff still 🙂 |
Some of the questions that I thought we might have to answer.
|
My answer would be more focused on what we want to achieve with this calendar, so if I have to answer the questions above.
My opinion is to narrow the scope, so we can avoid logic that needs to deal with conflicting configurations. e.g. Selecting a date range that includes a non available date. |
I think it makes sense what you say to primarily focus on the behaviour we need. Meaning it's a date- time picker, so you should always pick a date and time. In the future these could potentially be configurable but I don't have a current use case for that (point I also think some behaviour can be easily configured, like being able to select (past) dates or not. And what time slots to show. For example by passing "validor" functions or prop (point
For point |
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 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
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.
The text was updated successfully, but these errors were encountered: