0

I have date picker plugin in my packages, when I implement, I am able to see the calender. How can I see the calender .

This is what I have tried

                  <input
                    type="text"
                    class="form-control"
                    [(ngModel)]="selectedToDate"
                    [bsConfig]="{
                      dateInputFormat: 'DD-MMM-YYYY',
                    }"
                    [minDate]="selectedFromDate"
                    [maxDate]="maxDate"
                    name="toDate"
                    bsDatepicker
                  />

I have gone through different forums and followed the same but didnt help, please assist me.

2
  • try change type to "date" Commented Aug 7, 2023 at 10:49
  • do you have any errors on your console ? Commented Aug 7, 2023 at 10:55

1 Answer 1

0
  • Install ng-bootstrap in angular

npm i ng-bootstrap

datepicker.html
    <div class="input-group">
        <input
            class="form-control"
            placeholder="yyyy-mm-dd"
            name="dp"
            [(ngModel)]="model"
            ngbDatepicker
            #d="ngbDatepicker"
        />
        <button class="btn btn-outline-secondary bi bi-calendar3" 
         (click)="d.toggle()" type="button"></button>
      </div>

datepicker.ts
    import { Component } from '@angular/core';
    import { NgbAlertModule, NgbDatepickerModule, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
    import { FormsModule } from '@angular/forms';
    import { JsonPipe } from '@angular/common';
    
    @Component({
        selector: 'ngbd-datepicker-popup',
        standalone: true,
        imports: [NgbDatepickerModule, NgbAlertModule, FormsModule, JsonPipe],
        templateUrl: './datepicker-popup.html',
    })
    export class DatePicker {
        model: NgbDateStruct;
    }
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. Would you kindly edit your answer to include additional details for the benefit of the community?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.