twinssbc / AngularJS-ResponsiveCalendar

A pure AngularJS responsive calendar directive
http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/
MIT License
112 stars 77 forks source link

Don't colour day in month view based on event title #56

Closed captainmorgan0 closed 8 years ago

captainmorgan0 commented 8 years ago

I've been given a requirement not to have the day (in month view) highlight blue if there is only one event on a day and that event contains "Unavailable" in the title. Is this something that would easily be done? I can't figure out in your code, how I should do it.

twinssbc commented 8 years ago

@captainmorgan0 In month.html, below code controls the css class applies to each cell. You can add your logic there.

<td ng-repeat="dt in row track by dt.date" class="monthview-dateCell" ng-click="select(dt.date)"
                ng-class="{'text-center':true, 'monthview-current': dt.current&&!dt.selected&&!dt.hasEvent,'monthview-secondary-with-event': dt.secondary&&dt.hasEvent, 'monthview-primary-with-event':!dt.secondary&&dt.hasEvent&&!dt.selected, 'monthview-selected': dt.selected}">
                <div ng-class="{'text-muted':dt.secondary}">
                    {{dt.label}}
                </div>
            </td>
captainmorgan0 commented 8 years ago

I've looked at that, but I'm not sure how the template files are used. I made some changes to them, but they aren't reflected when I run my app.

twinssbc commented 8 years ago

It's because calendar-tpls.js already includes the templates. You need to run grunt build-tpls to generate a new calendar-tpls.js which includes your updated template.

slishnevsky commented 6 years ago

what is the meaning of "secondary"? when is "monthview-secondary-with-event" class applied to a cell?

twinssbc commented 6 years ago

@slishnevsky When displaying the current month, there are still couple days need to be displayed in previous and next month. These are the 'secondary' date.