Well trust users to come with all the good ideas. A request from the primary user on what I'm working on that I kind of like/dislike, in part I'm not fond of the added complexity however it kind of do make sense.
The idea basically is to have multiple event types to add to the calendar. A case could be having two types of events, say private and work. For instance having the private as green and work as red. As far as I can figure the logical implementation would be something like:
<multiple-date-picker ng-model="selectedDates" event-type="eventType" />
<select ng-model="eventType">
<option value="work">Work</option>
<option value="private">Private</option>
</select>
Then the selectedDates model would be an array of calendar objects, with the date and the type as elements:
{
date: momentFromCalendar,
eventType: $scope.eventType
}
or something like that. As for styling I think adding a css class with the name mdp-eventType
would make sense. Perhaps using toString() when inserting eventType to allow objects too, althought that may introduce complexities.
Having a more complex version as suggested would also require the date-click
to be updated appropriately to allow things like switching the event type based on the currently selected. One could imagine an interface where clicking a date once marks it as work, clicking it again marks it as private and a third time to remove it again.
As far as I see it the down side of this idea is that it will make the calendar slightly more complex. This may in part be mitigated by just defaulting to an array of moment objects when eventType
is not set, however again introducing issues if alternating between set and not set (perhaps detecting it and throwing an error in this case?).
On the up side it would allow a fair deal more complex use cases, such as the one I currently have as a suggestion (a bit more complex than work/private, but still). Also structuring it with objects like this will allow very flexible systems. Imagine adding a text
property to the objects to insert text in the calendar badge
etc. Even further, allowing the idea to wonder into a possibility of a future one could even imagine a template system like:
<multiple-date-picker ng-model="selectedDates">
<div class="calendarEntry">
<h1>{{entry.title}}</h1>
<p>{{entry.myPersonalText}}</p>
</div>
</multiple-date-picker>
allowing an extremely flexibly system for whatever the heart desires.
I'm not certain about the basic suggestion although there's some cool options in what it allows. Part of me kind of likes the added flexibility and feels that the cost isn't that high. Part of me doesn't like it because it can fast become adding this and that, and the nice and simple way to use this feels really good. If it can be done keeping it in the spirit of AngularJS with having it simple and intuitive, it might be a really good idea.
What say you?