Skip to content

Commit

Permalink
[APPS-2133] Migration from moment to date-fns with converter approach
Browse files Browse the repository at this point in the history
  • Loading branch information
kritagya09 committed Oct 3, 2023
1 parent b579138 commit fa29d4e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { TaskListService } from './../services/tasklist.service';
import { switchMap, defaultIfEmpty, takeUntil } from 'rxjs/operators';
import { UntypedFormBuilder, AbstractControl, Validators, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
import { UserProcessModel } from '../../common/models/user-process.model';
import { isValid, parse } from 'date-fns';
import { isValid } from 'date-fns';
import { DateFnsAdapter, MAT_DATE_FNS_FORMATS } from '@angular/material-date-fns-adapter';

const FORMAT_DATE = 'dd/MM/yyyy';
const FORMAT_DATE = 'DD/MM/YYYY';
const MAX_LENGTH = 255;

@Component({
Expand Down Expand Up @@ -190,7 +190,7 @@ export class StartTaskComponent implements OnInit, OnDestroy {
let date: Date;

if (typeof newDateValue === 'string') {
date = parse(newDateValue, FORMAT_DATE, new Date());
date = DateFnsUtils.parseDate(newDateValue, FORMAT_DATE);
} else {
date = newDateValue;
}
Expand Down

0 comments on commit fa29d4e

Please sign in to comment.