Questions tagged [ngb-datepicker]
82 questions
16
votes
1 answer
How to convert NgbDate to js Date object?
I am using an ng-bootstrap ngbDate object.
I would like to convert it to a standard Date object.
How do you do this?
Here is the relevant part of the .ts file:
import {NgbCalendar, NgbDate} from "@ng-bootstrap/ng-bootstrap";
fromDate:…

Baruch Gans
- 1,415
- 1
- 10
- 21
9
votes
1 answer
How can I start the calendar week in ng bootstrap Datepicker from Sunday instead of Monday?
I want to set the ngbDatepicker to begin the week on Sunday instead of the default day Monday.
I am trying to use weekStartsOn="0" but it has no effect.
This is my html code

Jake Neumann
- 372
- 4
- 13
5
votes
1 answer
How to make translations for NgbDatepicker in Angular without subclassing NgbDatepickerI18n?
I am currently reading about internationalization of the ng-bootstrap components. Their documentation says for the datepicker:
Since the 2.0.0 release datepicker will use the application locale if
it is present to get translations of weekdays and…

andreas
- 7,844
- 9
- 51
- 72
5
votes
2 answers
How to mark ngbDatepicker Valid in form even when no value is selected
I'm making use of ng-bootstrap's ngbDatepicker in a Reactive Form in an Angular2 project, and the dates are optional, however ngbDatepicker always marks the form as Invalid unless a date is selected.
Is there a way to exclude ngbDatepicker from the…

Stephen R. Smith
- 3,310
- 1
- 25
- 41
4
votes
3 answers
ngb-datepicker not working in angular material input(matInput)
I want to use ngb-datepicker in material Input . I applied datepicker to mat input successfully. but there is an issue with month and year dropdowns.
I tried following snippet :

Tejas
- 381
- 1
- 7
- 25
4
votes
2 answers
How to change date format in ngbDatepicker input field in angular bootstrap?
HTML:-
Date of birth

VIKAS KOHLI
- 8,164
- 4
- 50
- 61
4
votes
4 answers
Trying to get ngbdatepicker input value
I'm a beginner with angular 4 and I'm trying to implement a bootstrap ngbdatepicker in a website.
Here is my HTML code :

Yaël
- 61
- 1
- 2
- 7
3
votes
1 answer
NgbDatepicker in Reactive Forms: Set Initial Value
This might be one of the more frustrating issues I've coped with in a while. Dates and -- in particular -- NgbDatepicker are a bit of a bear to deal with in Angular, in general.
I'm implementing NgbDatepicker against reactive forms in Angular 8, and…

Michael Doleman
- 522
- 2
- 9
- 24
3
votes
1 answer
ERROR TypeError: date.equals is not a function when i add ngb datepicker in angular
ERROR TypeError: date.equals is not a function
I get that error on my console, which I don't know how to fix
at GlobalsidebarComponent.isRange (globalsidebar.component.ts:45)
at Object.eval [as updateRenderer] (GlobalsidebarComponent.html:26)
…

prerana pandey
- 29
- 5
3
votes
1 answer
How to disable past dates using ngbDatePicker Plugin on Angular
i'm using ngbDatePicker plugin in Angular, i have tried all javascript code in html but nothing works. Pastdate still enable to selected.
here's the html code
3
votes
6 answers
ngbDatepicker set value
In my Angular application, template driven form, I have a date of birth field and added ngbDatepicker for that field as given.

Denuka
- 1,142
- 3
- 13
- 21
2
votes
1 answer
Angular 13 ngbdatepicker doesn't show dropdown of months and years
im working on Angular 13 project with bootstrap 4. i want to show a datePicker feild using ngbdatepicker but my datePicker does'nt show the two dropdown in the top (list of months and list of years). this is my code:

James
- 1,190
- 5
- 27
- 52
2
votes
1 answer
Angular Dynamic Forms with ngbDatepicker causes freeze
I am building a dynamic form with Angular. Everything works fine, until I try to dynamically generate a ngbDatePicker input and the page completely freezes.
Does anyone know what causes the page to hang when inserting an ngbDatepicker…

franksev
- 73
- 1
- 6
2
votes
2 answers
ng-bootstrap: ngb-datepicker initial value with angular reactive form group is not getting set
I am working with ngb-datepicker which is working fine if no initial
values or predefined values are set but when trying to use it
formControlName or with [(ngModel)] with an existing predefined
value the predefined or initial value is not setting…

Yash Mehta
- 31
- 6
2
votes
2 answers
Is there a way to use NgbDatepicker's navigateTo() on the component other than using it on ngAfterViewInit()?
I am using the NgbDatepicker
It can be done on ngAfterViewInit() like:
@ViewChild('dp') datepicker: NgbDatepicker;
ngAfterViewInit() {
…

Nehal Jaisalmeria
- 414
- 7
- 22