Ionic-Calendar
Ionic-Calendar copied to clipboard
Start and end hours on week view and day view
It would be great if there's an option to set the calendar start and end hours. i.e.: Instead of drawing 24 hours, you could only show from 8am to 6pm.
@foini I think this requirement is not a common one and requires fairly big modification, so I won't add that option. Feel free to fork and modify it to meet your needs. If you meet any issue, feel free to let me know. Thanks.
@fonini There are other people asking similar questions, you may contact with them. https://github.com/twinssbc/AngularJS-ResponsiveCalendar/issues/32 You can also add some grey boxes on the out-of-business hours to mark these time as disabled.
@fonini sir did you find a solution to this. i tried creating a custom angular filter, however it did not work. @twinssbc Could you help me with trying to find where can i do this.
@Krypternite If you want to change the the start and end hours, you need to modify multiple places. The general idea is:
- you need to change the slots displayed in the view
- you need to filter the event based on your start and end hour
- you need to calculate the position of each event based on your start hour instead of the 0:00 AM I think "hour" and "24" are good keywords to search in my code. That's where I usually do the calculation using hours.
for (hour = 0; hour < 24; hour += 1) {
@twinssbc Thanks a lot.
@twinssbc
You can also add some grey boxes on the out-of-business hours to mark these time as disabled.
How would I do this?
@skramzy You could use weekviewNormalEventTemplateUrl option to render some custom template. The custom template allow you set different background color for different type of event. Then you could assign dummy event to out-of-business hours, and set the background color to grey. Ideally, I recommend you start using Ionic2-Calendar, it has the built-in support for setting start hour and end hour.