Questions tagged [ngb-datepicker]

82 questions
0
votes
1 answer

How to get ElementRef from NgbDatepicker in custom NgbDatepickerKeyboardService?

I have a custom service that extends NgbDatepickerKeyboardService and I need to get an ElementRef to datepicker in processKey method. The main idea is to get ElementRef and to query from this reference trying to find a div of the next day (I need to…
blackhard
  • 502
  • 7
  • 26
0
votes
1 answer

use startDate as YYYY-MM-DD instead of year,month,day

Is possible to use in ngb-datepicker startDate as YYYY-MM-DD ? Now I got
Marcin Domorozki
  • 51
  • 1
  • 3
  • 12
0
votes
3 answers

How to compare date and time in Angular

I'm trying to compare current date and time with ngb date and time picker which is in JSON format: var todayTime = new Date(); Output: Tue Jun 09 2020 17:43:30 GMT+0530 (India Standard Time) I want to compare this with the below date and time…
Anjana
  • 366
  • 5
  • 21
0
votes
1 answer

Angular ngbDatePicker - do something when user selects a date from Calendar

Goal: I would like to reset the text color in the matinput to black when a user selects (any) date from the ngbDatePicker CALENDAR. I set it to make text red if they type in a future date. I want it to go back to black if they select a date from the…
angleUr
  • 449
  • 1
  • 8
  • 27
0
votes
0 answers

Unable to select and display in ngbdatepicker for 4000 years

I am using ngbDatepicker in my angular application. I have a couple of requirements. In the year select box, I need to limit the user to select a year up to 4000. At the same time, I need infinite navigation behavior which is the default in…
vinzzy
  • 1
0
votes
1 answer

ng-bootstrap ngbDatepicker shown behing ng-template modal

I'm building a form within a modal, shown in a ng-template tag. @ng-bootstrap/bootstrap Datepicker popup is stuck behind modal, like the picture below. How do I push calendar popup to front? Ng Bootstrap and Angular versions are listed…
lsilva
  • 147
  • 2
  • 17
0
votes
1 answer

Programmatically set date of NgbDatePicker

I've two NgbDatePicker in my component: input( type="text", ngbDatepicker, #d="ngbDatepicker", [readonly]="true", formControlName='startDate', (dateSelect)='setNewMinDate($event)', ) …
Nemus
  • 1,322
  • 2
  • 23
  • 47
0
votes
1 answer

How to remove arrows of year from ngb datepicker

When I use ngb-datepicker, I set [minDate] and [maxDate] for one year. So users can only choose a date within one year. But I want to remove the arrows that show beside the year-picker-box. Is it possible to remove them? My code:
0
votes
0 answers

Form control invalid with ngbDatePicker

I have the following input and works normally to save
renanvm
  • 208
  • 3
  • 16
0
votes
0 answers

Set Current Date as Selected in NgbDatepicker - Angular

I'm trying to set the current date as selected in NgbDatepicker using the following code. (I'm using reactive form.) ngOnInit() { this.createEmployeeLunchEntryForm(); } createEmployeeLunchEntryForm() { const currentDate = new Date(); const…
Arfizur Rahman
  • 384
  • 4
  • 13
0
votes
1 answer

Error: "formControlName must be used with a parent formGroup directive." for

I have a date picker with the input field and pop-up configured as described there: https://ng-bootstrap.github.io/#/components/datepicker/overview So, I have 1) tag with all needed imports done in the template:
Eljah
  • 4,188
  • 4
  • 41
  • 85
0
votes
2 answers

Ngb Date Picker minDate and maxDate not working as expected

I have used ngbDatePicker for selecting multiple dates. I want to disable date before the current date. But when I use minDate directive only the past month was disabled not the dates before to-day. Template:
NicoleZ
  • 1,485
  • 3
  • 22
  • 43
0
votes
1 answer

Is it possible to change ngbDatepicker formatter dynamically?

I am looking for a way to toggle between different date formatters (e.g. mm-dd-yyyy / dd-mm-yyyy) on the ngbDatepicker control based on the user selection. Any ideas/help is appreciated.
Cheff
  • 79
  • 1
  • 3
0
votes
0 answers

Use case for input[ngbdatepicker] directive

Attempting to intorduce the ngbDatePicker into the project, after installation and configuring the module. It just won't work with the approach I am currently taking. This is to use the input[ngbDatepicker] directive provided by bootstrap. I have…
Chief
  • 854
  • 12
  • 27
0
votes
0 answers

Ngbdatepicker, increment Ndbdate function

I am trying to make an array with selected dates. I was able to so for the start/end date. Now, I am trying to do it for the inside dates (dates between the start/end date). To do so, I am first building this function: getDates(start: NgbDate, end:…
AbdalRahman Farag
  • 197
  • 1
  • 8
  • 18