i'm using ngx-bootstrap datepicker in my angular project, i want to use the french version of datepicker, but it gives always in english version heres my code :
html :
<input type='text' class="form-control" placeholder="Date de l'aller :" bsDatepicker formControlName="dateDepart" />
component.ts:
import { defineLocale } from 'ngx-bootstrap/chronos';
import { fr } from 'ngx-bootstrap/locale';
defineLocale('fr', fr);
any help please, on how to use ngx-boostrap datepicker with french version?
Looks like you defined locale but haven't actually set it. Inject BsLocaleService
from ngx-bootstrap/datepicker
in your component and call its use('fr')
method. Check the example here - https://valor-software.com/ngx-bootstrap/#/datepicker#locales (go to component
tab and take a look at the code)