Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply custom styles to the ng-bootstrap datepicker?

Tags:

ng-bootstrap

I'm using the ng-bootstrap datepicker (if you scroll down its the "Basic Datepicker") in my angular 2 application, but want to apply custom styles. How is that done? I don't see anything about it in the ng-bootstrap documentation.

like image 966
Dave Avatar asked Feb 05 '23 17:02

Dave


2 Answers

I was able to change its styling when putting css settings in the style.scss file instead of component's styling file

/*@src/style.scss*/

ngb-datepicker {
    position: absolute;
    background-color: white;

    .ngb-dp-header {
        background-color: rgba(52,104,191,1);
    }

    select {
        background-color: rgba(52,104,191,1);
        color: white;
    }
}
like image 136
Roy Yin Avatar answered Apr 26 '23 21:04

Roy Yin


As of today you can provide a custom template for a data cell thus influencing look & feel of day display. This is demonstrated in the "Custom day view" section of the documentation.

like image 34
pkozlowski.opensource Avatar answered Apr 26 '23 22:04

pkozlowski.opensource