mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5878] implemented migration using the convertor approach (#8953)
This commit is contained in:
committed by
GitHub
parent
d72eb5ebd3
commit
21a029163a
@@ -20,9 +20,8 @@ import { exampleProcess, mockError, fakeProcessDef, fakeTasksList } from '../../
|
||||
import { ProcessFilterParamRepresentationModel } from '../models/filter-process.model';
|
||||
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
|
||||
import { ProcessService } from './process.service';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { CoreModule, DateFnsUtils } from '@alfresco/adf-core';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
describe('ProcessService', () => {
|
||||
let service: ProcessService;
|
||||
@@ -288,7 +287,7 @@ describe('ProcessService', () => {
|
||||
const task = tasks[0];
|
||||
expect(task.id).toBe(fakeTasks[0].id);
|
||||
expect(task.name).toBe(fakeTasks[0].name);
|
||||
expect(task.created).toEqual(format(new Date('2016-11-10T00:00:00+00:00'), 'yyyy-MM-dd'));
|
||||
expect(task.created).toEqual(DateFnsUtils.formatDate(new Date('2016-11-10T00:00:00+00:00'), 'YYYY-MM-DD'));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, FormValues } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, DateFnsUtils, FormValues } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
TasksApi,
|
||||
@@ -34,7 +34,6 @@ import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ProcessListModel } from '../models/process-list.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -213,7 +212,7 @@ export class ProcessService {
|
||||
.pipe(
|
||||
map(this.extractData),
|
||||
map((tasks) => tasks.map((task: any) => {
|
||||
task.created = format(new Date(task.created), 'yyyy-MM-dd');
|
||||
task.created = DateFnsUtils.formatDate(new Date(task.created), 'YYYY-MM-DD');
|
||||
return task;
|
||||
})),
|
||||
catchError((err) => this.handleProcessError(err))
|
||||
|
Reference in New Issue
Block a user