Gathering detailed insights and metrics for @mat-datetimepicker/core
Gathering detailed insights and metrics for @mat-datetimepicker/core
Gathering detailed insights and metrics for @mat-datetimepicker/core
Gathering detailed insights and metrics for @mat-datetimepicker/core
npm install @mat-datetimepicker/core
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
153 Stars
515 Commits
84 Forks
7 Watching
4 Branches
23 Contributors
Updated on 09 Nov 2024
TypeScript (77.16%)
HTML (12.27%)
SCSS (8.2%)
JavaScript (2.37%)
Cumulative downloads
Total Downloads
Last day
15.6%
3,222
Compared to previous day
Last week
2.4%
15,074
Compared to previous week
Last month
0.3%
67,925
Compared to previous month
Last year
24%
675,854
Compared to previous year
1
4
The example application is on GitHub Pages!
The datetimepicker was initially taken from Promact/md2
and modified to
use @angular/material
. We have also added theming support.
Like the @angular/material
datepicker
it contains a native-datetime-adapter
as well as a moment-datetime-adapter
.
Install:
1npm install --save @mat-datetimepicker/core
And for the moment adapter:
1npm install --save @angular/material-moment-adapter mat-datetimepicker/moment
Basically the same way the @angular/material
datepicker is configured and imported.
1imports: [ 2 ...MatDatepickerModule, 3 // use this if you want to use native javascript dates and INTL API if available 4 // MatNativeDatetimeModule, 5 MatMomentDatetimeModule, 6 MatDatetimepickerModule, 7];
1<form [formGroup]="group"> 2 <mat-form-field> 3 <mat-placeholder>Start DateTime</mat-placeholder> 4 <mat-datetimepicker-toggle [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle> 5 <mat-datetimepicker #datetimePicker type="datetime" openOnFocus="true" timeInterval="5"> </mat-datetimepicker> 6 <input matInput formControlName="start" [matDatetimepicker]="datetimePicker" required autocomplete="false" /> 7 </mat-form-field> 8</form>
In order to change the default input/output formats, a custom instance of MAT_DATETIME_FORMATS
needs to be provided in
the global configuration.
Input/output formats can be changed separately for the existing datetime picker types
date
, month
, datetime
and time
.
You can use the following properties to provide values for ARIA- attributes:
Property | Description | Default |
---|---|---|
ariaNextMonthLabel | aria-label for the Next button in the month mode | "Next month" |
ariaPrevMonthLabel | aria-label for the Previous button in the month mode | "Previous month" |
ariaNextYearLabel | aria-label for the Next button in the year mode | "Next year" |
ariaPrevYearLabel | aria-label for the Previous button in the year mode | "Previous year" |
The component supports property bindings or pipes with the aria- values.
Parsing does not work with the native adapter because the Intl.DateTimeFormat API does not provide that feature.
1providers: [ 2 { 3 provide: MAT_DATETIME_FORMATS, 4 useValue: { 5 parse: {}, 6 display: { 7 dateInput: { 8 year: 'numeric', 9 month: '2-digit', 10 day: '2-digit', 11 }, 12 monthInput: { 13 month: 'long', 14 }, 15 datetimeInput: { 16 year: 'numeric', 17 month: '2-digit', 18 day: '2-digit', 19 hour: '2-digit', 20 minute: '2-digit', 21 }, 22 timeInput: { 23 hour: '2-digit', 24 minute: '2-digit', 25 }, 26 monthYearLabel: { 27 year: 'numeric', 28 month: 'short', 29 }, 30 dateA11yLabel: { 31 year: 'numeric', 32 month: 'long', 33 day: 'numeric', 34 }, 35 monthYearA11yLabel: { 36 year: 'numeric', 37 month: 'long', 38 }, 39 popupHeaderDateLabel: { 40 weekday: 'short', 41 month: 'short', 42 day: '2-digit', 43 }, 44 }, 45 }, 46 }, 47];
@see defaults in native-datetime-formats.ts
@see Intl.DateTimeFormat
API documentation
1providers: [ 2 { 3 provide: MAT_DATETIME_FORMATS, 4 useValue: { 5 parse: { 6 dateInput: 'L', 7 monthInput: 'MMMM', 8 timeInput: 'LT', 9 datetimeInput: 'L LT', 10 }, 11 display: { 12 dateInput: 'L', 13 monthInput: 'MMMM', 14 datetimeInput: 'L LT', 15 timeInput: 'LT', 16 monthYearLabel: 'MMM YYYY', 17 dateA11yLabel: 'LL', 18 monthYearA11yLabel: 'MMMM YYYY', 19 popupHeaderDateLabel: 'ddd, DD MMM', 20 }, 21 }, 22 }, 23];
@see defaults in moment-datetime-formats.ts
@see moment.js documentation
1@import '@mat-datetimepicker/core/datetimepicker/datetimepicker-theme.scss'; 2 3// Using the $theme variable from the pre-built theme you can call the theming function 4@include mat-datetimepicker-theme($theme);
@see src/styles.scss
Run npm install
in order to install all required dependencies and initialize the Git hooks. Further instructions are
available in the DEVELOPMENT.md
.
Make sure you read at least the "Committing" section before committing anything.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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