mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6189] Moved date adapter from module to component (#9029)
This commit is contained in:
@@ -21,6 +21,8 @@ import { ProcessFilterProperties, ProcessFilterOptions } from '../../process/pro
|
|||||||
import { FormGroup, FormControl } from '@angular/forms';
|
import { FormGroup, FormControl } from '@angular/forms';
|
||||||
import { DateRangeFilter, DateCloudFilterType } from '../../models/date-cloud-filter.model';
|
import { DateRangeFilter, DateCloudFilterType } from '../../models/date-cloud-filter.model';
|
||||||
import { endOfDay, isValid, startOfDay } from 'date-fns';
|
import { endOfDay, isValid, startOfDay } from 'date-fns';
|
||||||
|
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||||
|
import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '@alfresco/adf-core';
|
||||||
|
|
||||||
interface DateRangeFormProps {
|
interface DateRangeFormProps {
|
||||||
from: FormControl<Date>;
|
from: FormControl<Date>;
|
||||||
@@ -30,7 +32,11 @@ interface DateRangeFormProps {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-cloud-date-range-filter',
|
selector: 'adf-cloud-date-range-filter',
|
||||||
styleUrls: ['./date-range-filter.component.scss'],
|
styleUrls: ['./date-range-filter.component.scss'],
|
||||||
templateUrl: './date-range-filter.component.html'
|
templateUrl: './date-range-filter.component.html',
|
||||||
|
providers: [
|
||||||
|
{ provide: DateAdapter, useClass: AdfDateFnsAdapter },
|
||||||
|
{ provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class DateRangeFilterComponent implements OnInit {
|
export class DateRangeFilterComponent implements OnInit {
|
||||||
@Input()
|
@Input()
|
||||||
|
@@ -16,12 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { ADF_DATE_FORMATS, AdfDateFnsAdapter, CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
import { DateRangeFilterComponent } from './date-range-filter/date-range-filter.component';
|
import { DateRangeFilterComponent } from './date-range-filter/date-range-filter.component';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DateRangeFilterService } from './date-range-filter/date-range-filter.service';
|
import { DateRangeFilterService } from './date-range-filter/date-range-filter.service';
|
||||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [ DateRangeFilterComponent ],
|
declarations: [ DateRangeFilterComponent ],
|
||||||
@@ -34,9 +33,7 @@ import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|||||||
DateRangeFilterComponent
|
DateRangeFilterComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
DateRangeFilterService,
|
DateRangeFilterService
|
||||||
{ provide: DateAdapter, useClass: AdfDateFnsAdapter },
|
|
||||||
{ provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ProcessCommonModule {}
|
export class ProcessCommonModule {}
|
||||||
|
Reference in New Issue
Block a user