Expose internal date and add support for events in calendar view #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Exposing the internal date object
I've added support for exposing the internal date object of the calendar view. You can use this as follows:
<div pickadate ng-model="calendarDate" current-date="calendarCurrentDate"></div>
Now,
calendarCurrentDate
will be theDate
object of the calendars' current view. For instance, when the user sees "December 2015", and callscalendarCurrentDate.getMonth()
it will return the month number.Showing events on the calendar
I've also added support for supplying an array with formatted dates to show in the calendar. Use it like this:
<div pickadate ng-model="calendarDate" dates-with-events="calendarPopulatedDates"></div>
In my case, I've added dates like this:
Note: this may not be the most efficient way to do this.
It looks like this:
To conclude
This is one of my first pull requests. I hope everything is right! If not, please let me know. I'll gladly update my code.