Angular UI Components Documentation
The Angular DateTimeInput lets users type a date or time, or pick it from a drop-down calendar. This guide adds the Angular DateTimeInput (jqxDateTimeInput) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxdatetimeinput 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxDateTimeInputModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxDateTimeInputModule } from 'jqwidgets-ng/jqxdatetimeinput';
@Component({
selector: 'app-root',
imports: [jqxDateTimeInputModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<label>Date Input</label>
<jqxDateTimeInput
[width]="300" [height]="25">
</jqxDateTimeInput>
<br />
<label>Time Input</label>
<jqxDateTimeInput
[width]="300" [height]="30" [formatString]="'T'" [showTimeButton]="true" [showCalendarButton]="false">
</jqxDateTimeInput>
<br />
<label>Date Time Input</label>
<jqxDateTimeInput
[width]="300" [height]="30" [formatString]="'F'" [showTimeButton]="true">
</jqxDateTimeInput>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxDateTimeInputModule } from 'jqwidgets-ng/jqxdatetimeinput';
@Component({
imports: [CommonModule, jqxDateTimeInputModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, change: This event is triggered on blur when the value is changed .
<jqxDateTimeInput (onChange)="onChange($event)"></jqxDateTimeInput>
onChange(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, val: Gets or sets the jqxDateTimeInput's value.
<jqxDateTimeInput #myDateTimeInput></jqxDateTimeInput>
import { Component, viewChild } from '@angular/core';
import { jqxDateTimeInputModule, jqxDateTimeInputComponent } from 'jqwidgets-ng/jqxdatetimeinput';
@Component({
selector: 'app-root',
imports: [jqxDateTimeInputModule],
templateUrl: './app.html'
})
export class App {
readonly myDateTimeInput = viewChild.required<jqxDateTimeInputComponent>('myDateTimeInput');
run(): void {
const value = this.myDateTimeInput().val();
console.log(value);
}
}