[ACS-6189] broken decision table dates after deprecation of moment date adapter 3 (#9026)

* ACS-6189 Fixed date format

* ACS-6189 Fixed unit test

* ACS-6189 Reverted unwanted changes

* ACS-6189 Fixed date format
This commit is contained in:
AleksanderSklorz
2023-10-25 15:28:58 +02:00
committed by GitHub
parent e6bc457d26
commit 67f1a4c506
4 changed files with 7 additions and 44 deletions

View File

@@ -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 {}

View File

@@ -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',

View File

@@ -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'
}
};

View File

@@ -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';