2

I'm using Angular version 20. Month and year selection are missing. I have tried more methods, however I am still facing issues.

Imports: CommonModule, FormsModule, ReactiveFormsModule, NgScrollbarModule, CardComponent, MaterialModules,NgbDatepickerModule, NgbModule

(https://i.sstatic.net/7oZaPyBe.png)

<div class="row p-t-25">
  <div class="col-12">
    <app-card cardTitle="Hello card">
      <form #userlogin="ngForm">
        <div class="row">
          <div class="col">
            <div class="form-group">
              <label class="float-label"><span class="red">*</span>From Date</label>
              <div class="input-group py-2">
                <input
                class="form-control"
                placeholder="yyyy-mm-dd"
                name="fromDate"
                [(ngModel)]="formData.fromDate"
                ngbDatepicker
                #d2="ngbDatepicker"
                [navigation]="'select'"
              />
              <button class="btn btn-outline-secondary bi bi-calendar3" type="button" (click)="d2.toggle()">
                📅
              </button>

             </div>
            </div>
          </div>
          <div class="col">
            <div class="form-group">
              <label class="float-label"><span class="red">*</span>To Date</label>
              <div class="input-group py-2">
                <input
                  class="form-control"
                  placeholder="yyyy-mm-dd"
                  name="dp"

                  [(ngModel)]="formData.toDate"
                  ngbDatepicker
                  #d="ngbDatepicker"
                />
                <button class="btn btn-outline-secondary bi bi-calendar3" (click)="d.toggle()" type="button"> 📅</button>
            </div>
            </div>
          </div>

        </div>
        <hr class="mt-4" style="color: darkgrey;">

      </form>
    </app-card>
  </div>
</div>

2
  • 1
    please share a stackblitz with the issue happening, steps to replicate and expected output from the stackblitz, kindly use the stackblitz examples provided in the ngb website Commented Sep 17 at 10:41
  • pay attention to the version of ng-bootstrap and version of bootstrap.css (you can see the correct versions in the docs, e.g. for Angular 20 you need ng-bootstrap 19.x.x and bootstrap 5.3.6. But possible your app-card has a css overflow that makes you can not see the "months" (using F12 you can see if the header is or not) Commented Sep 17 at 10:54

1 Answer 1

0

My polyfills got dropped when I upgraded angular and they needed to get re-added to angular.json (specifically, it was the angular localize line)

"polyfills": [
              "zone.js",
              "@angular/localize/init"
            ],

Source:
https://stackoverflow.com/a/76100353/4172413

Sign up to request clarification or add additional context in comments.

Comments

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.