Gathering detailed insights and metrics for @ah99/ngx-date-picker
Gathering detailed insights and metrics for @ah99/ngx-date-picker
Gathering detailed insights and metrics for @ah99/ngx-date-picker
Gathering detailed insights and metrics for @ah99/ngx-date-picker
npm install @ah99/ngx-date-picker
Typescript
Module System
Node Version
NPM Version
70.4
Supply Chain
96.3
Quality
75.6
Maintenance
100
Vulnerability
98.9
License
TypeScript (56.67%)
HTML (21.7%)
SCSS (19.08%)
JavaScript (2.1%)
CSS (0.45%)
Total Downloads
2,351
Last Day
3
Last Week
6
Last Month
43
Last Year
480
4 Stars
61 Commits
3 Forks
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.2-beta
Package Id
@ah99/ngx-date-picker@1.0.2-beta
Unpacked Size
414.46 kB
Size
93.46 kB
File Count
39
NPM Version
6.14.8
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last day
50%
3
Compared to previous day
Last week
-33.3%
6
Compared to previous week
Last month
-12.2%
43
Compared to previous month
Last year
-42.9%
480
Compared to previous year
1
3
ngx-date-picker is a customizable jalali ( persian ) and gregorian date picker for Angular +12
1npm i @ah99/ngx-date-picker
1import { NgxDatePickerModule } from '@ah99/ngx-date-picker' 2 3@NgModule({ 4 imports: [ 5 NgxDatePickerModule.forRoot() // dont forget forRoot() 6 ] 7})
1 @import "@ah99/ngx-date-picker/styles"
use ngx-date-picker
directive on any html input element
you need
1 <input ngx-date-picker [(ngModel)]="dateControl">
important: you need to setup one form model in your input element with formControl or ngModel So you must have already imported FormsModule or ReactiveFormsModule in your module.
There are some options for config your date picker as below:
Option | Type | Default | Description |
---|---|---|---|
calendar | "gregorian" | "jalali" | "gregorian" | Type of your calendar |
format | ValueFormat | "DD/MM/YYYY" | Format of your input element value |
outputData | object | OutputEvent Config | Output values from the onDateSelect event |
displayFooter | boolean | true | This option is for date picker action buttons. date picker will be closed immediately after selecting the date if this option set to false. |
doneText | string | "Done" | Done action text |
cancelText | string | "Cancel" | Done action text |
theme | "light" | "dark" | "light | Date picker theme mode |
themeConfig | object | Default Theme Config | You can change default styles like Primary-Color in light and dark mode |
1"MM/DD/YYYY" | "MM-DD-YYYY" | "DD-MM-YYYY" | "DD/MM/YYYY"
1outputData: { 2 date: true, // boolean 3 type: false, // boolean 4 year: false, // boolean 5 month: false, // boolean 6 day: false // boolean 7}
1themeConfig: { 2 light: { 3 primaryColor: "#777777", // string 4 secondaryColor: "#444444", // string 5 backgroudColor: "#ffffff" // string 6 }, 7 dark: { 8 primaryColor: "#ffffff", //string 9 secondaryColor: "#eeeeee", // string 10 backgroudColor: "#444444" // string 11 }, 12 rounded: "medium" // flase | "medium" | "full" 13}
If you want customize default configs, you can do it in two ways:
Define your configs inside the NgxDatePickerModule.forRoot() . This configs will be applied to all date pickers.
1NgxDatePickerModule.forRoot({ 2 calendar: "jalali", 3 displayFooter: false, 4 theme: "dark", 5 themeConfig: { 6 rounded: "full", 7 dark: { 8 primaryColor: "#bbbbbb" 9 } 10 } 11})
All of your configs will be merged with default configs
You can set individual configs for every date picker by pass your custom configs to it with datePickerConfig.
1<!-- HTML template --> 2 3<input ngx-date-picker [(ngModel)]="dateControl" 4[datePickerConfig]="customConfig">
1// typescript component 2 3import { CustomConfig } from '@ah99/ngx-date-picker'; 4... 5customConfig: CustomConfig = { 6 calendar: "gregorian", 7 format: "DD-MM-YYYY", 8 themeConfig: { 9 light: { 10 primaryColor: "#ca8c07" 11 } 12 } 13}
Your individual configs will be merged with global configs
This event will be triggered when you select the date. The output value will be an object whose fields you can specify in OutputEvent Config.
1<input ngx-date-picker [(ngModel)]="dateControl" 2(onDateSelect)="log($event)">
No vulnerabilities found.
No security vulnerabilities found.