Installations
npm install angular-material-components-zigzag-datetime-picker
Developer Guide
Typescript
No
Module System
ESM
Node Version
18.12.1
NPM Version
8.19.2
Score
57
Supply Chain
85.4
Quality
75.2
Maintenance
100
Vulnerability
89
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (74.91%)
HTML (13.07%)
SCSS (10.68%)
JavaScript (1.34%)
Developer
Download Statistics
Total Downloads
20,363
Last Day
2
Last Week
6
Last Month
54
Last Year
17,728
GitHub Statistics
335 Stars
351 Commits
171 Forks
13 Watching
9 Branches
5 Contributors
Bundle Size
118.47 kB
Minified
19.72 kB
Minified + Gzipped
Package Meta Information
Latest Version
16.0.0
Package Id
angular-material-components-zigzag-datetime-picker@16.0.0
Unpacked Size
1.05 MB
Size
242.43 kB
File Count
43
NPM Version
8.19.2
Node Version
18.12.1
Publised On
20 Jul 2023
Total Downloads
Cumulative downloads
Total Downloads
20,363
Last day
100%
2
Compared to previous day
Last week
20%
6
Compared to previous week
Last month
74.2%
54
Compared to previous month
Last year
572.8%
17,728
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Angular Material DatetimePicker, Timepicker for @angular/material 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x
Description
A DatetimePicker like @angular/material Datepicker by adding support for choosing time.
DEMO
@see LIVE DEMO AND DOCUMENTATION
@see DEMO stackblitz
Choose the version corresponding to your Angular version:
Angular | @angular-material-components/datetime-picker |
---|---|
15 | 9.x+ |
14 | 8.x+ |
13 | 7.x+ |
12 | 6.x+ |
11 | 5.x+ |
10 | 4.x+ |
9 | 2.x+ |
8 | 2.x+ |
7 | 2.x+ |
Getting started
npm install --save @angular-material-components/datetime-picker
Setup
Basically the same way the @angular/material Datepicker is configured and imported.
import { NgxMatDatetimePickerModule, NgxMatTimepickerModule } from '@angular-material-components/datetime-picker';
@NgModule({
...
imports: [
BrowserModule,
HttpClientModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
NgxMatTimepickerModule,
FormsModule,
ReactiveFormsModule,
MatButtonModule,
NgxMatDatetimePickerModule,
],
...
})
export class AppModule { }
@see src/app/demo-datetime/demo-datetime.module.ts
Using the component
The same API as @angular/material Datepicker (@see API docs)
Datetime Picker (ngx-mat-datetime-picker)
<mat-form-field>
<input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date" [formControl]="dateControl"
[min]="minDate" [max]="maxDate" [disabled]="disabled">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker [showSpinners]="showSpinners" [showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond"
[touchUi]="touchUi" [color]="color" [enableMeridian]="enableMeridian"
[disableMinute]="disableMinute" [hideTime]="hideTime">
</ngx-mat-datetime-picker>
</mat-form-field>
Timepicker (ngx-mat-timepicker)
<ngx-mat-timepicker [(ngModel)]="date"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [disabled]="disabled"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [stepHour]="2" [stepMinute]="5" [stepSecond]="10"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [showSpinners]="showSpinners"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [showSeconds]="showSeconds"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [disableMinute]="disableMinute"></ngx-mat-timepicker>
<ngx-mat-timepicker [(ngModel)]="date" [defaultTime]="defaultTime"></ngx-mat-timepicker>
<ngx-mat-timepicker [formControl]="formControl"></ngx-mat-timepicker>
List of @Input of ngx-mat-timepicker
You can use all @Input of ngx-mat-timepicker for ngx-mat-datetime-picker
@Input | Type | Default value | Description |
---|---|---|---|
disabled | boolean | null | If true, the picker is readonly and can't be modified |
showSpinners | boolean | true | If true, the spinners above and below input are visible |
showSeconds | boolean | true | If true, it is not possible to select seconds |
disableMinute | boolean | false | If true, the minute (and second) is readonly |
defaultTime | Array | undefined | An array [hour, minute, second] for default time when the date is not yet defined |
stepHour | number | 1 | The number of hours to add/substract when clicking hour spinners |
stepMinute | number | 1 | The number of minutes to add/substract when clicking minute spinners |
stepSecond | number | 1 | The number of seconds to add/substract when clicking second spinners |
color | ThemePalette | undefined | Color palette to use on the datepicker's calendar. |
enableMeridian | boolean | false | Whether to display 12H or 24H mode. |
hideTime | boolean | false | If true, the time is hidden. |
touchUi | boolean | false | Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather than a popup and elements have more padding to allow for bigger touch targets. |
Choosing a date implementation and date format settings
The datepicker was built to be date implementation agnostic. This means that it can be made to work with a variety of different date implementations. However it also means that developers need to make sure to provide the appropriate pieces for the datepicker to work with their chosen implementation.
The easiest way to ensure this is to import one of the provided date modules:
NgxMatNativeDateModule | NgxMatMomentModule | |
---|---|---|
Date type | Date | Moment |
Supported locales | en-US | See project for details |
Dependencies | None | Moment.js |
Import from | @angular-material-components/datetime-picker | @angular-material-components/moment-adapter |
To use NgxMatMomentModule:
npm install --save @angular-material-components/moment-adapter
Please note: NgxMatNativeDateModule is based off the functionality available in JavaScript's native Date object. Thus it is not suitable for many locales. One of the biggest shortcomings of the native Date object is the inability to set the parse format.
We highly recommend using the NgxMatMomentModule or a custom NgxMatDateAdapter that works with the formatting/parsing library of your choice.
For example:
Creating a custom date adapter:
@Injectable()
export class CustomDateAdapter extends NgxMatDateAdapter<D> {...}
// D can be Date, Moment or customized type
Creating a custom date adapter module
@NgModule({
providers: [
{
provide: NgxMatDateAdapter,
useClass: CustomDateAdapter,
deps: [MAT_DATE_LOCALE, NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS]
}
],
})
export class CustomDateModule { }
You can also customize the date format by providing your custom NGX_MAT_DATE_FORMATS in your module.
// If using Moment
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
dateInput: "l, LTS"
},
display: {
dateInput: "l, LTS",
monthYearLabel: "MMM YYYY",
dateA11yLabel: "LL",
monthYearA11yLabel: "MMMM YYYY"
}
};
//and in the module providers
providers: [
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_MOMENT_FORMATS }
]
Theming
- @see @angular/material Using a pre-built theme
- Add the Material Design icon font to your index.html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 26 are checked with a SAST tool
Reason
43 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc
Score
2.3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More