1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Datepicker ngx-bootstrap

Discussão em 'Angular' iniciado por Miomir Dancevic, Novembro 3, 2024 às 22:22.

  1. I am trying to apply locale on old datepicker

    https://valor-software.com/ngx-bootstrap/#/datepicker

    I have tried evrything and i dont know where to look further, i can use the new one, but i have big solution that i have to stay on old datepicker

    Here is what i have

    my.module.ts

    import { CommonModule } from '@angular/common';
    import { DatepickerModule } from 'ngx-bootstrap/datepicker';

    @NgModule({
    imports: [
    DatepickerModule.forRoot()
    ],
    declarations: [

    ],
    providers: [

    ],
    schemas: [
    CUSTOM_ELEMENTS_SCHEMA
    ]
    })
    export class MyModule {
    }


    my.component.ts

    import { defineLocale } from 'ngx-bootstrap/bs-moment';
    import { de } from 'ngx-bootstrap/locale';
    defineLocale('de', de);


    @Component({
    templateUrl: './my.component.html',
    styleUrls: ['./my.component.scss']
    })

    export class MyComponent implements OnInit {}


    my.component.html

    <datepicker formControlName="effectiveDate" [showWeeks]="false" [locale]="de">


    Can't bind to 'locale' since it isn't a known property of 'datepicker'. :(

    Continue reading...

Compartilhe esta Página