Skip to content

Commit

Permalink
Merge pull request #9 from hmcts/RDM-2014
Browse files Browse the repository at this point in the history
RDM-2014 fix for Date field that prevents moving forward
  • Loading branch information
hemantt authored Apr 25, 2018
2 parents b416ebc + 742071c commit 4d7ba2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "1.0.2",
"version": "1.0.3",
"description": "Case UI Toolkit",
"main": "./dist/index.umd.js",
"module": "./dist/index.js",
Expand Down
10 changes: 8 additions & 2 deletions src/components/form/date-input/date-input.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, forwardRef, Input } from '@angular/core';
import {Component, forwardRef, Input, OnDestroy} from '@angular/core';
import { AbstractControl, FormControl, ValidationErrors } from '@angular/forms';
import { ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } from '@angular/forms';

Expand All @@ -18,7 +18,7 @@ import { ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } fro
}
],
})
export class DateInputComponent implements ControlValueAccessor, Validator {
export class DateInputComponent implements ControlValueAccessor, Validator, OnDestroy {
@Input()
public id: string;

Expand Down Expand Up @@ -73,6 +73,12 @@ export class DateInputComponent implements ControlValueAccessor, Validator {
// Do nothing.
}

public ngOnDestroy() {
this.validate = (control: AbstractControl): ValidationErrors => {
return undefined;
};
}

public dayChange(event: any) {
// get value from input
this.day = event.target.value;
Expand Down

0 comments on commit 4d7ba2b

Please sign in to comment.