twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

Month dot indicators and how to customize the month's list items #36

Closed winstonpang closed 8 years ago

winstonpang commented 8 years ago

Hello,

Great component, definitely fills the void in the calendar components around.

Firstly, in month view, is there anyway to show some dots for each day that has any events?

Secondly, for the events list in month view, can I control any other information to show for each event item?

Thank you!

twinssbc commented 8 years ago

@squaredonut

It's possible to add dots under the day, basically for days having events will get assigned the "monthview-primary-with-event" css class. Then you just need to override the style of this class. For example,

.monthview-primary-with-event:after {
    content: '.';
    display: block;
    font-size: 12px;
    font-weight:bold;
    line-height: 0px;
}

Regarding the second question, currently the calendar doesn't expose the option to show more information of the event. Other user also asked the similar question, I plan to expose some options. You can also fork my repository and customize it for your own needs. Below code snippets in month.html is the place you need to modify.

<table class="table table-bordered table-striped table-fixed event-detail-table">
            <tr ng-repeat="event in selectedDate.events" ng-click="eventSelected({event:event})">
                <td ng-if="!event.allDay" class="monthview-eventdetail-timecolumn">{{::event.startTime|date: 'HH:mm'}}
                    -
                    {{::event.endTime|date: 'HH:mm'}}
                </td>
                <td ng-if="event.allDay" class="monthview-eventdetail-timecolumn">All day</td>
                <td class="event-detail">{{::event.title}}</td>
            </tr>
            <tr ng-if="!selectedDate.events">
                <td class="no-event-label" ng-bind="::noEventsLabel"></td>
            </tr>
</table>
winstonpang commented 8 years ago

Oh great, ok I will try those suggestions, thank you for the reply!