SHARE
TWEET

Untitled

a guest Aug 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onValChange(event: Date) {
  2.     const datePipe = new DatePipe('en-US');
  3.     const val = datePipe.transform(event, 'MM/dd/yyyy');
  4.     this.writeValue(moment(event));
  5.   }
  6.      
  7. <input class="form-control form-control-sm requiredV" [(ngModel)]="dateValue"
  8.              placeholder="mm/dd/yyyy" name="dateField" id="dateField" ngbDatepicker
  9.              #dateFieldngb="ngbDatepicker" [required]="isRequired"
  10.              [ngClass]="{'isUntouched':formName.submitted}" (ngModelChange)="onValChange($event)"
  11.              (keypress)="allow_only_numbers($event)" (click)="dateFieldngb.toggle()" />
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top