Ionic-Calendar icon indicating copy to clipboard operation
Ionic-Calendar copied to clipboard

Start and end hours on week view and day view

Open fonini opened this issue 9 years ago • 7 comments

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.

fonini avatar Jan 27 '16 17:01 fonini

@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.

twinssbc avatar Jan 28 '16 12:01 twinssbc

@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.

twinssbc avatar Jan 29 '16 00:01 twinssbc

@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 avatar May 27 '16 05:05 Krypternite

@Krypternite If you want to change the the start and end hours, you need to modify multiple places. The general idea is:

  1. you need to change the slots displayed in the view
  2. you need to filter the event based on your start and end hour
  3. 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 avatar May 27 '16 14:05 twinssbc

@twinssbc Thanks a lot.

Krypternite avatar Jan 05 '17 14:01 Krypternite

@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?

steviecs avatar Apr 06 '18 17:04 steviecs

@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.

twinssbc avatar Apr 08 '18 01:04 twinssbc