ng2-flatpickr icon indicating copy to clipboard operation
ng2-flatpickr copied to clipboard

ng2 flatpickr returns array

Open kavinGurusamy opened this issue 4 years ago • 2 comments

Hi why did flatpickr sends array as input to server. I am using it in angular reactive forms when i submit a form it does not bind my formatting options and return output as array.

` exampleOptions: FlatpickrOptions = { allowInput: true, dateFormat: "Y-m-d G:i:S K", enableTime: true, altFormat: "Y-m-d G:i:S K", altInput: true, formatDate: (date: string) => {
return moment(date).format("YYYY-MM-DD hh:mm:ss a");
}

}`

`

    <label for="end"> EndTime </label>      
    
   
    <ng2-flatpickr type="text" id="end" name="end" [config]="exampleOptions" formControlName="endDateTime" placeholder="Enter end time"></ng2-flatpickr>
    

   </div>`

kavinGurusamy avatar May 27 '21 07:05 kavinGurusamy

I have the same issue when I used it as a FormControl in FormArray, but while using it in a FormGroup everything works fine

IbrahimAyed1 avatar May 22 '22 20:05 IbrahimAyed1

you have to get bind (change)="getDate($event)" event to get formated date

Fahad11-dev avatar Sep 14 '23 07:09 Fahad11-dev