Open Closed

The Angular date picker is not displaying. #9986


User avatar
0
Jamesreal created

I followed the tutorial to create the Acme.BookStore application with the ABP Suite. The date picker for the publish date of the entity book does not pop up. There are some errors in the browser console.

ABP Suite Version: 9.3.5

  • Template: app
  • Created ABP Studio Version: 1.3.3
  • Current ABP Studio Version: 1.3.3
  • Tiered: No
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Theme Menu Placement: side
  • Run Install Libs: Yes
  • Progressive Web App: No
  • Run Progressive Web App Support: No
  • Database Provider: ef
  • Database Management System: postgresql
  • Separate Tenant Schema: No
  • Create Initial Migration: Yes
  • Run Db Migrator: Yes
  • Mobile Framework: none
  • Public Website: No
  • Social Login: Yes
  • Include Tests: Yes
  • Kubernetes Configuration: Yes
  • Distributed Event Bus: none
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • TextTemplateManagement
    • LanguageManagement
    • AuditLogging
    • OpenIddictAdmin
  • Selected Languages: English, Arabic, Chinese (Simplified), Chinese (Traditional), Czech, English (United Kingdom), Finnish, French, German (Germany), Hindi , Hungarian, Icelandic, Italian, Portuguese (Brazil), Romanian (Romania), Russian, Slovak, Spanish, Swedish, Turkish
  • Default Language: English
  • Create Command: abp new Acme.BookStore -t app --ui-framework angular --database-provider ef --database-management-system postgresql --theme leptonx --without-cms-kit --dont-run-bundling -no-file-management

3 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    To resolve the issue where the Angular date picker (NgBootstrap datepicker) is not displaying in your ABP Angular application, ensure the following steps are completed:

    1. Import NgbDatepickerModule
      In your book.module.ts, import and add NgbDatepickerModule to the imports array:
    import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
    
       @NgModule({
         declarations: [BookComponent],
         imports: [
           BookRoutingModule,
           SharedModule,
           NgbDatepickerModule, // <-- Add this line
         ]
       })
       export class BookModule { }
    
    1. Provide NgbDateAdapter
      In your book.component.ts, add the following provider to ensure the date picker works with JavaScript Date objects:
    import { NgbDateNativeAdapter, NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap';
    
       @Component({
         selector: 'app-book',
         templateUrl: './book.component.html',
         styleUrls: ['./book.component.scss'],
         providers: [
           ListService,
           { provide: NgbDateAdapter, useClass: NgbDateNativeAdapter } // <-- Add this line
         ],
       })
       export class BookComponent implements OnInit {
         // ...
       }
    
    1. Check Your Template
      Make sure your template uses the date picker correctly:
    <input
         #datepicker="ngbDatepicker"
         class="form-control"
         name="datepicker"
         formControlName="publishDate"
         ngbDatepicker
         (click)="datepicker.toggle()"
       />
    
    1. Install NgBootstrap
      If you haven't already, install @ng-bootstrap/ng-bootstrap:
    yarn add @ng-bootstrap/ng-bootstrap
    

    or

    npm install @ng-bootstrap/ng-bootstrap
    
    1. Restart the Angular App
      After making these changes, restart your Angular development server.

    These steps should resolve the error and make the date picker work as expected.

    Sources:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    Jamesreal created

    I know how to fix error codes generated by the ABP Suite. I hope you can fix apb suite so it generates correct code.

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello,

    May I ask whether you have been using the standalone or module-based structure? We will also be updating the samples and tutorials.

    You can let us know if you need further assistance. Thank you for your cooperation.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on October 13, 2025, 08:48