Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

How to set the left offset of events? #494

Closed
qmy777 opened this issue Nov 15, 2016 · 1 comment
Closed

How to set the left offset of events? #494

qmy777 opened this issue Nov 15, 2016 · 1 comment

Comments

@qmy777
Copy link

qmy777 commented Nov 15, 2016

There seems no way to set the left offset of events.

In the source of angular-bootstrap-calendar.js, from line 3850 - line 3883

function getDayView(events, viewDate, dayViewStart, dayViewEnd, dayViewSplit) {

	      var dayStart = (dayViewStart || '00:00').split(':');
	      var dayEnd = (dayViewEnd || '23:59').split(':');

	      var view = calendarUtils.getDayView({
	        events: events.map(function(event) { // hack required to work with event API
	          event.start = event.startsAt;
	          event.end = event.endsAt;
	          return event;
	        }),
	        viewDate: viewDate,
	        hourSegments: 60 / dayViewSplit,
	        dayStart: {
	          hour: dayStart[0],
	          minute: dayStart[1]
	        },
	        dayEnd: {
	          hour: dayEnd[0],
	          minute: dayEnd[1]
	        },
	        eventWidth: 150,
	        segmentHeight: 30
	      });

	      // remove hack to work with new event API
	      events.forEach(function(event) {
	        delete event.start;
	        delete event.end;
	      });

	      return view;

	    }

There have a key that can set the left offset of every events: eventWidth: 150,
but this 150 is not configurable. So, how should I configure this property to make sure when width is changed, the position of event is changed?

@mattlewis92
Copy link
Owner

This should now be possible in 0.27.0, thanks for the suggestion!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants