Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ng2 flatpickr returns array #107

Open
kavinGurusamy opened this issue May 27, 2021 · 2 comments
Open

ng2 flatpickr returns array #107

kavinGurusamy opened this issue May 27, 2021 · 2 comments

Comments

@kavinGurusamy
Copy link

kavinGurusamy commented May 27, 2021

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>`
@IbrahimAyed1
Copy link

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

@Fahad11-dev
Copy link

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants