search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

text-align: right does not work for *_event_inner class

Asked by Anonymous
3 years ago.

Hi,
I'm trying to align the event text to the right using "text-align: right" into the CSS class *_event_inner. However this doesn't work, because of the propery "display: flex;". If I remove "display: flex;" then it works. But I suppose this will have side effects on the behavior of the scheduler?
Thanks

Answer posted by Dan Letecky [DayPilot]
3 years ago.

You can override "display: flex" if needed. It is only used to enable vertical centering within the event box.

You can also keep "display: flex" and use "justify-content" to align the event text to the right:

.scheduler_default_event_inner {
    justify-content: flex-end;
}
Comment posted by Anonymous
3 years ago.

Thank you for the instant answer!

Comment posted by Anonymous
3 years ago.

Hi,

The solution with "justify-content: flex-end;" works very well. I'm using this now to align events with numbers to the right. However I have also events with text, which I want to align to left. I used onBeforeEventRender event and the cssClass property. But the CSS class "time-reporting-board-event-workprofile" is added to *_event CSS class which get overriden by the *_event_inner CSS class

onBeforeEventRender: (args) => {
if (args.data.tags.rowTypeKey == 'Workprofile') {
args.data.cssClass = 'time-reporting-board-event-workprofile';
}
}

Is there any solution for conditional aligment of the event's text?

Thank you

Comment posted by Dan Letecky [DayPilot]
3 years ago.

You'll need to adjust the CSS selector to include the path:

.time-reporting-board-event-workprofile .scheduler_default_event_inner {
  justify-content: flex-start;
  /* ... */
}
Answer posted by Anonymous
3 years ago.

Thank you very much. Using CSS to change the appearance is really good.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.