Skip to content

Commit

Permalink
ACS-6189 Moved date adapter from module to component
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksanderSklorz committed Oct 26, 2023
1 parent 67f1a4c commit 3d11db3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { ProcessFilterProperties, ProcessFilterOptions } from '../../process/pro
import { FormGroup, FormControl } from '@angular/forms';
import { DateRangeFilter, DateCloudFilterType } from '../../models/date-cloud-filter.model';
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 {
from: FormControl<Date>;
Expand All @@ -30,7 +32,11 @@ interface DateRangeFormProps {
@Component({
selector: 'adf-cloud-date-range-filter',
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 {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
*/

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 { MaterialModule } from '../material.module';
import { CommonModule } from '@angular/common';
import { DateRangeFilterService } from './date-range-filter/date-range-filter.service';
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';

@NgModule({
declarations: [ DateRangeFilterComponent ],
Expand All @@ -34,9 +33,7 @@ import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
DateRangeFilterComponent
],
providers: [
DateRangeFilterService,
{ provide: DateAdapter, useClass: AdfDateFnsAdapter },
{ provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }
DateRangeFilterService
]
})
export class ProcessCommonModule {}

0 comments on commit 3d11db3

Please sign in to comment.