nep-date
v1.0.1
Published
Nepali date picker component for angular
Downloads
3
Maintainers
Readme
NepDatePicker
Angular date picker library for nepali date / AD and BS
This project was generated with Angular CLI version 16.0.3.
Installation
Install the package using the following command:
npm install NepDateModule
Usage
Import NepDateModule
in your app module like this:
import { NepDateModule } from 'NepDateModule';
@NgModule({
declarations: [...],
imports: [..., NepDateModule, ...],
providers: [...],
bootstrap: [...],
})
and in your component :
<nep-date-picker><nep-date-picker/>
Properties
Inputs
| Name | Type | Default Value | Description |
|------------|------------------------|---------------|---------------------------------------|
| language
| 'en' | 'ne' | 'ne' | Specifies the language for the date format. |
| hasFuture
| boolean | true | Indicates whether future dates are allowed. |
| format
| string | 'yy-mm-dd' | The date format to be used. 'dd-mm-yy' or 'yy-mm-dd' |
| isRange
| boolean | false | Specifies whether the date selection is a range. |
Outputs
| Name | Type | Description |
|------------------|------------------|--------------------------------------------|
| onDateChange
| EventEmitter | Event emitted when the selected date(s) change. |
For single date the output will be in the following format . i.e when isRange is false
{
"nepaliDate": {
"year": ,
"month": ,
"day":
},
"englishDate": {
"year": ,
"month": ,
"day":
}
}
And when range is set to true, i.e when isRange is false, the output will be as :
{
"fromDate": {
"nepaliDate": {
"year": ,
"month": ,
"day":
},
"englishDate": {
"year": ,
"month": ,
"day":
}
},
"toDate": {
"nepaliDate": {
"year": ,
"month": ,
"day":
},
"englishDate": {
"year": ,
"month": ,
"day":
}
}
}