Replies: 1 comment 2 replies
-
Hello @dfidler I'm going answer your questions and provide insight into what may seem an anti pattern, but it has been implemented with good reason.
That being said, there's nothing preventing anyone from using the standalone components and building a
I hope I provided you with more context regarding the design decisions that were made when implementing these components and that you'll find the library easy to work with. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Needed a date/time picker to replace my custom one (which I inherited, and hate) so, yesterday, thought I'd give reka a go as the base for my new one (experiment).
In looking at the anatomy of Calendar and DatePicker, I'm wondering why DatePicker replicates all of the Calendar components with different names. In my head, that seems like an anti-pattern (not DRY) as it stands to reason that a calendar is always going to be the same as the calendar inside of the date picker.
I've nearly done my date/picker and I've modeled, mostly, after re-ui's date picker (picking the time from a list) and I like it. But now I want create a calendar item like reka's and have realised that... ooops...I have to duplicate code (or refactor my current code).
I'm just wondering, is it worthwhile to merge those two trees? Because at the end of the day, the "DatePicker" is really just a DateField that acts as an anchor for a [Range]Calendar. I think that, rather than making a date picker component, it makes more sense to have links to an example date/time picker that reuses those two components in one. That would be DRY.
Which I guess brings up another use case, why is there a "Calendar" and a "Range Calendar"? Picking a "range" is just a feature of a calendar. And the anchor for both of those is simply a Date Field and a Date Range field.
So why have separate component/class hierarchies for both?
To me, it makes more sense to have the basic building blocks and then supply examples that show the combined use of them.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions