项目作者: NilavPatel
项目描述 :
Angular date picker component
高级语言: TypeScript
项目地址: git://github.com/NilavPatel/np-ui-date-picker-package.git
np-ui-date-picker
Angular 9 Native date picker component.
Check demo Here
NPM
$ npm i np-ui-date-picker
HTML
<np-ui-date-picker
[(ngModel)]="startDate">
</np-ui-date-picker>
Properties
ngModel
: Date
two way date binding model value.
value must be date type object. format
: string
pass date format as string, date will be shown in given format in text box.
default format is dd/MM/yyyy disabled
: boolean
true/false - set component disabled. required
: boolean
default value is false. add required attribute to input textbox. defaultOpen
: boolean
default open datepicker, user can not close this. no textbox will be shown. minDate
: Date
no date will be selected less than min date.
Default calender shows min year upto CurrentYear - 100, but if need to set years less than that,
then set minDate validation with less year numbers. maxDate
: Date
no date will be selected greater than max date.
Default calender shows max year upto CurrentYear + 100, but if need to set years more than that, then set maxDate validation with high year numbers. placeholder
: string
set placeholder for datepicker showTodayButton
: boolean
show/hide Today link in datepicker pop up, on click of link today’s date will be set as selected. disableWeekDays
: string[]
disable week days for date picker. Possible values for array are “Su”, “Mo”, “Tu”, “We”, “Th”, “Fr”, “Sa”. disableDates
: Date[]
disable dates in date picker. Assign array of dates to this property. dateLabels
: any[]
Example: [{ date : new Date(), label: “Today”}]
Lables tooltip will be shown on hover of dates passed in this property.isStartMonthWithMonday
: boolean
If set to true then month will be start with Monday, default value is false. styleClass
: string
set name of css class.
Methods
onChange
on change event binding.
Other np-ui components for Angular
- Data grid
- Date picker
- Time picker
- Color picker
License
This project is licensed under the MIT License.
Contributors
