Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@dhutaryan/ngx-mat-timepicker

dhutaryan8.1kMIT19.2.0TypeScript support: included

Angular timepicker to add time which is based on material design and Angular material.

angular, angular material, timepicker, material timepicker, time picker, timepicker popup, timepicker input

readme

ngx-mat-timepicker

npm code factor license npm bundle size

The timepicker module using Angular material.

Versions

mat-timepicker Angular
19.x.x >=19.0.0
18.x.x >=18.0.0
17.x.x ^17.0.0
16.x.x ^16.0.0
15.x.x ^15.0.0
14.x.x ^14.0.0
13.x.x >=13.0.0 && <15.0.0
12.x.x >=12.0.0 && <15.0.0

Documentation

Check out the documentation.

Installation

You have to install the Angular Material and set it up. Learn more about the setup.

Install the library:

$ npm install --save @dhutaryan/ngx-mat-timepicker

or

$ yarn add @dhutaryan/ngx-mat-timepicker

Getting started

Import MatTimepickerModule to your project.

import { MatTimepickerModule } from "@dhutaryan/ngx-mat-timepicker";

@NgModule({
  imports: [
    // ...
    MatTimepickerModule,
    // ...
  ],
})
export class MyModule {}

Adapter

Add a timepicker adapter.

import { MatTimepickerModule, provideNativeDateTimeAdapter } from "@dhutaryan/ngx-mat-timepicker";

@NgModule({
  imports: [
    // ...
    MatTimepickerModule,
    // ...
  ],
  providers: [provideNativeDateTimeAdapter()]
})
export class MyModule {}

or create your own

import { MatTimepickerModule } from "@dhutaryan/ngx-mat-timepicker";

@NgModule({
  imports: [
    // ...
    MatTimepickerModule,
    // ...
  ],
  providers: [{ provide: TimeAdapter, useClass: MyTimeAdapter }],
})
export class MyModule {}

Theming

Then you have to define a theme. More details about theming.

@use "@dhutaryan/ngx-mat-timepicker" as mat-timepicker;

// timepicker uses these component
@include mat.form-field-theme(theme.$ngx-mat-timepicker-theme);
@include mat.input-theme(theme.$ngx-mat-timepicker-theme);
@include mat.button-theme(theme.$ngx-mat-timepicker-theme);
@include mat.fab-theme(theme.$ngx-mat-timepicker-theme);
@include mat.icon-button-theme(theme.$ngx-mat-timepicker-theme);
@include mat.divider-theme(theme.$ngx-mat-timepicker-theme);

// timepicker theme
@include mat-timepicker.timepicker-theme($theme);

// if you want to support color attribute in M3 add compatibility mixin
@include mat.color-variants-backwards-compatibility($my-theme)

You can also use mat.theme mixin instead.

Usage

<mat-form-field>
  <input type="text" matInput [matTimepicker]="timepicker" />
  <mat-timepicker-toggle matSuffix [for]="timepicker"></mat-timepicker-toggle>
  <mat-timepicker #timepicker></mat-timepicker>
</mat-form-field>

Locale

Default locale is en-US. You can set your locale as:

import { NgModule } from '@angular/core';
import { MAT_TIME_LOCALE } from "@dhutaryan/ngx-mat-timepicker";

@NgModule({
  imports: [
    // ...
  ],
  providers: [{ provide: MAT_TIME_LOCALE, useValue: "en-GB" }],
})
export class MyModule {}

License

MIT

changelog

19.2.0

  • feat(time-inputs): provide keydown handler token (#209)

19.1.1

  • fix(theme): use correct css property for separator line height (#207)

19.1.0

  • feat(theme): support mat system colors (#199)

19.0.0

  • feat(timepicker): support angular and angular material v19 (#193)

18.0.4

  • fix(inlt): add intl update trigger (#194)

18.0.3

  • fix(intl): add strings for am/pm (#190)

18.0.2

  • fixed incorrect @include statement (#176)

18.0.1

  • fix(timepicker): use correct elevation for m3 (#176)
  • fix(timepicker): add missing theme imports (#175)

18.0.0

  • feat(timepicker): add material 3 support and tokens api (#171)

17.6.3

  • fix(inlt): add intl update trigger (#194)

17.6.2

  • fix(intl): add strings for am/pm (#190)

17.6.1

  • fixed incorrect @include statement (#176)

17.6.0

  • feat(timepicker): restore focus after timepicker is closed (#169)
  • fix: allow to type using numpad (#166)

17.5.1

  • fix(inputs): allow to use tab key (#163)
  • fix(timepicker): use changedetector ref after minute and hour change (#162)

17.5.0

  • fix(adapter): take am/pm value into account (#158)
  • feat(adapter): add provider function for native date time (#155)

17.4.2

  • fix(theme): use timepicker selectors to override styles (#150)

17.4.1

  • fix(inputs): allow to enter some special chars (#145)

17.4.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

17.3.0

  • fix(dials): replace injected window object (#135)
  • feat(timepicker): move to standalone components (#134)

17.2.0

  • feat(timepicker): add touchUi property to make some elements bigger (#128)

17.1.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(dials): prevent scroll for inline mode (#116)
  • fix(timepicker): increase css weight for close button (#115)

17.0.1

  • feat(timepicker): change default colors for toggle icon (#110)

17.0.0

  • build(deps): bump angular and angular material to v17 (#106)

16.4.3

  • fix(inlt): add intl update trigger (#194)

16.4.2

  • fix(intl): add strings for am/pm (#190)

16.4.1

  • fixed incorrect @include statement (#176)

16.4.0

  • feat(timepicker): restore focus after timepicker is closed (#169)
  • fix: allow to type using numpad (#166)

16.3.1

  • fix(inputs): allow to use tab key (#163)
  • fix(timepicker): use changedetector ref after minute and hour change (#162)

16.3.0

  • fix(adapter): take am/pm value into account (#158)
  • feat(adapter): add provider function for native date time (#155)

16.2.2

  • fix(theme): use timepicker selectors to override styles (#150)

16.2.1

  • fix(inputs): allow to enter some special chars (#145)

16.2.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

16.1.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(dials): prevent scroll for inline mode (#116)
  • fix(timepicker): increase css weight for close button (#115)

16.0.2

  • feat(timepicker): change default colors for toggle icon (#110)

16.0.1

  • fix(dials): handle touch move action (#103)
  • fix(input): set value for empty input after apply with no changes (#101)

16.0.0

  • build(deps): bump angular and angular material to v16 (#95)

15.4.3

  • fix(inlt): add intl update trigger (#194)

15.4.2

  • fix(intl): add strings for am/pm (#190)

15.4.1

  • fixed incorrect @include statement (#180)

15.4.0

  • feat(timepicker): restore focus after timepicker is closed (#169)
  • fix: allow to type using numpad (#166)

15.3.1

  • fix(inputs): allow to use tab key (#163)
  • fix(timepicker): use changedetector ref after minute and hour change (#162)

15.3.0

  • fix(adapter): take am/pm value into account (#158)
  • feat(adapter): add provider function for native date time (#155)

15.2.2

  • fix(theme): use timepicker selectors to override styles (#150)

15.2.1

  • fix(inputs): allow to enter some special chars (#145)

15.2.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

15.1.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(dials): prevent scroll for inline mode (#116)
  • fix(timepicker): increase css weight for close button (#115)

15.0.3

  • feat(timepicker): change default colors for toggle icon (#110)

15.0.2

  • fix(dials): handle touch move action (#103)
  • fix(input): set value for empty input after apply with no changes (#101)

15.0.0

  • build(deps): bump angular and angular material to v15 (#92)

14.2.4

  • fix: allow to type using numpad (#166)

14.2.3

  • fix(inputs): allow to use tab key (#163)

14.2.2

  • fix(theme): use timepicker selectors to override styles (#150)

14.2.1

  • fix(inputs): allow to enter some special chars (#145)

14.2.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

14.1.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(timepicker): increase css weight for close button (#115)

14.0.0

  • build(deps): bump angular and angular material to v14 (#90)

13.2.4

  • fix: allow to type using numpad (#166)

13.2.3

  • fix(inputs): allow to use tab key (#163)

13.2.2

  • fix(theme): use timepicker selectors to override styles (#150)

13.2.1

  • fix(inputs): allow to enter some special chars (#145)

13.2.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

13.1.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(timepicker): increase css weight for close button (#115)

13.0.0

  • build(deps): bump angular and angular material to v13 (#87)

12.5.4

  • fix: allow to type using numpad (#166)

12.5.3

  • fix(inputs): allow to use tab key (#163)

12.5.2

  • fix(theme): use timepicker selectors to override styles (#150)

12.5.1

  • fix(inputs): allow to enter some special chars (#145)

12.5.0

  • fix(inputs): prevent letters from being type (#142)
  • feat(actions): use string from intl (#141)

12.4.0

  • fix(timepicker): disable timepicker toggle if input is disabled (#124)
  • fix(input): add min/max attributes (#123)
  • fix(input): add missed export for MatTimepickerInputEvent (#122)
  • fix(timepicker): increase css weight for close button (#115)

12.3.1

  • fix(dials): prevent scrolling by clicking space (#84)

12.3.0

  • feature(dials): add animation while switching hour and minute dials (#81)
  • fix(time-inputs): keep the same value if input value is a string (#80)
  • feat(time-faces): handle time changing by arrows (#79)

12.2.0

  • feat(timepicker): add orientation for dial (#74)
  • feat(timepicker): add minute interval option (#73)

12.1.0

  • feat(timepicker): add accessibility features (#65)
  • fix(time-face): add public change event for inline usage (#63)
  • feat(timepicker): add possibility to show/hide toggle mode button (#56)

12.0.1

  • fix(dials): remove unnecessary color for disabled buttons (#50)

12.0.0

  • feat(clock-dial): select time from dials
  • feat(time-inputs): select time using inputs
  • feat(actions): default and customized actions
  • feat(adapter): use abstract adapter for operations
  • feat(intl): put string to intl file
  • feat(timepicker): min and max values