https://github.com/mozhn/datepicker
Multiple datepicker for Angular 8
https://github.com/mozhn/datepicker
angular angular2 component datepicker multiple-datepicker
Last synced: 3 months ago
JSON representation
Multiple datepicker for Angular 8
- Host: GitHub
- URL: https://github.com/mozhn/datepicker
- Owner: mozhn
- License: gpl-3.0
- Created: 2019-10-05T09:28:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-06T22:55:28.000Z (about 2 years ago)
- Last Synced: 2025-01-16T13:17:45.891Z (4 months ago)
- Topics: angular, angular2, component, datepicker, multiple-datepicker
- Language: TypeScript
- Homepage: https://mozhn.github.io/datepicker/index.html
- Size: 249 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Datepicker
Multiple datepicker for Angular.
## Installation
Use the package manager [npm](https://www.npmjs.com/package/@mozhn/datepicker) to install datepicker.
```bash
npm install @mozhn/datepicker --save
```## Usage
```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, LOCALE_ID } from '@angular/core';
import { registerLocaleData } from '@angular/common';
import localeTr from '@angular/common/locales/tr';
import { AppComponent } from './app.component';import { DatepickerModule } from '@mozhn/datepicker';
registerLocaleData(localeTr, 'tr');
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
DatepickerModule
],
providers: [
{ provide: LOCALE_ID, useValue: 'tr' }
],
bootstrap: [AppComponent]
})export class AppModule { }
```
Select language after including module.```typescript
import { Component, ViewChild } from '@angular/core';
import { DatepickerComponent } from '@mozhn/datepicker';type DataType = 'time' | 'string' | 'date';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})export class AppComponent {
@ViewChild(DatepickerComponent, {
static: true
}) datepicker: DatepickerComponent;public readonly type: DataType = 'string'
dateList = [
new Date('2019-10-01'),
new Date('2019-10-02'),
new Date('2019-10-23')
];timeList = [
1569888000000,
1570492800000
]stringList = ['2019-10-01','2019-10-02','2019-10-08'];
openCalendar() {
this.datepicker.status = !this.datepicker.status;
}
}
``````typescript
Open Calendar
-
{{item}}
-
{{item}}
```
There are 3 data types. These date object, time and string.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.