File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/app/modules/shared/components/input-date Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11< input
22 [value] ="value "
33 [disabled] ="isDisabled "
4- (dateInput) ="onInput($event.target.value.format('YYYY-MM-DD') ) "
4+ (dateInput) ="onInput($event.target.value) "
55 class ="form-control "
66 aria-label ="Small "
77 aria-describedby ="inputGroup-sizing-sm "
Original file line number Diff line number Diff line change 11import { Component , forwardRef } from '@angular/core' ;
22import { ControlValueAccessor , NG_VALUE_ACCESSOR } from '@angular/forms' ;
33import { MatDatepicker } from '@angular/material/datepicker' ;
4+ import { DATE_FORMAT_YEAR } from 'src/environments/environment' ;
5+ import * as moment from 'moment' ;
46
57@Component ( {
68 selector : 'app-input-date' ,
@@ -23,8 +25,8 @@ export class InputDateComponent implements ControlValueAccessor {
2325 constructor ( ) {
2426 }
2527
26- onInput ( value : string ) {
27- this . value = value ;
28+ onInput ( value : moment . Moment ) {
29+ this . value = value . format ( DATE_FORMAT_YEAR ) ;
2830 this . onTouch ( ) ;
2931 this . onChange ( this . value ) ;
3032 }
You can’t perform that action at this time.
0 commit comments