diff --git a/lib/process-services-cloud/src/lib/common/process-common.module.ts b/lib/process-services-cloud/src/lib/common/process-common.module.ts index 82fb18b6261..9c6309fb329 100644 --- a/lib/process-services-cloud/src/lib/common/process-common.module.ts +++ b/lib/process-services-cloud/src/lib/common/process-common.module.ts @@ -16,11 +16,12 @@ */ import { NgModule } from '@angular/core'; -import { CoreModule } from '@alfresco/adf-core'; +import { ADF_DATE_FORMATS, AdfDateFnsAdapter, 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 ], @@ -33,7 +34,9 @@ import { DateRangeFilterService } from './date-range-filter/date-range-filter.se DateRangeFilterComponent ], providers: [ - DateRangeFilterService + DateRangeFilterService, + { provide: DateAdapter, useClass: AdfDateFnsAdapter }, + { provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS } ] }) export class ProcessCommonModule {} diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.ts index 9043723b8e6..f94231c0602 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.ts @@ -20,15 +20,14 @@ import { Component, OnInit, ViewEncapsulation, OnDestroy, Input } from '@angular/core'; import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core'; import { Subject } from 'rxjs'; -import { WidgetComponent, FormService, AdfDateFnsAdapter, DateFnsUtils } from '@alfresco/adf-core'; +import { WidgetComponent, FormService, AdfDateFnsAdapter, DateFnsUtils, ADF_DATE_FORMATS } from '@alfresco/adf-core'; import { MatDatepickerInputEvent } from '@angular/material/datepicker'; -import { CLOUD_FORM_DATE_FORMATS } from '../../../date-formats'; import { addDays, subDays } from 'date-fns'; @Component({ selector: 'date-widget', providers: [ - { provide: MAT_DATE_FORMATS, useValue: CLOUD_FORM_DATE_FORMATS }, + { provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }, { provide: DateAdapter, useClass: AdfDateFnsAdapter } ], templateUrl: './date-cloud.widget.html', diff --git a/lib/process-services-cloud/src/lib/form/date-formats.ts b/lib/process-services-cloud/src/lib/form/date-formats.ts deleted file mode 100644 index 64aebc4e891..00000000000 --- a/lib/process-services-cloud/src/lib/form/date-formats.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { MatDateFormats } from '@angular/material/core'; - -/** - * Provides date/time display formatting for the cloud components. - * - * Notes for developers: display formats are different from the storage formats. - * Components have a fixed format for saving dates and datetime values, - * while dynamic format for UI display. - */ -export const CLOUD_FORM_DATE_FORMATS: MatDateFormats = { - parse: { - dateInput: 'dd-MM-yyyy' - }, - display: { - dateInput: 'dd-MM-yyyy', - monthLabel: 'LLL', - monthYearLabel: 'LLL uuuu', - dateA11yLabel: 'PP', - monthYearA11yLabel: 'LLLL uuuu' - } -}; diff --git a/lib/process-services-cloud/src/lib/form/public-api.ts b/lib/process-services-cloud/src/lib/form/public-api.ts index aede55d9745..deea686958f 100644 --- a/lib/process-services-cloud/src/lib/form/public-api.ts +++ b/lib/process-services-cloud/src/lib/form/public-api.ts @@ -40,4 +40,3 @@ export * from './services/content-cloud-node-selector.service'; export * from './services/process-cloud-content.service'; export * from './form-cloud.module'; -export * from './date-formats';