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
12 days 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]
12 days 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
12 days ago.

Thank you for the instant answer!

Comment posted by Anonymous
11 days 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]
11 days 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
11 days ago.

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

New Reply
This reply is
Your name (optional):