how to use altFormat with an input group?
See original GitHub issueHi again!
Sorry if it is in the docs, but I couldn’t find how to do it.
I have an input group and when I initialize the flatpickr instance with altInput
and altFormat
inside the options, the new input (the one with altFormat
) appears completely unformatted, without classes or anything.
My code: HTML
<div
class="input-group flatpickr"
data-wrap="true"
>
<div class="input-group-addon" data-toggle>
<span class="fa fa-calendar"></span>
</div>
<input
type="text"
class="form-control"
data-input
data-open
/>
</div>
JS
flatpickr('.flatpickr' {
dateFormat: 'Y-m-d',
altInput: true,
altFormat: 'd/m/Y',
onChange: date => { ... },
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
altFormat not working in jQuery datepicker input field
The altFormat option doesn't control the formatting of the input with the date picker, but the format of an alternate (usually hidden) field...
Read more >Options - Flatpickr
Config Option Type Default
altFormat String "F j, Y"
altInput Boolean false
altInputClass String ""
Read more >jQuery UI Datepicker altFormat Option - GeeksforGeeks
In this article, we will see how to use the altFormat option in jQuery UI ... < p >Enter Date: < input type...
Read more >flatpickr - lightweight datetimepicker & calendar - UNPKG
altInput can be used for displaying a friendly date format (per altFormat ) to the user while sending the date formatted as dateFormat...
Read more >Datepicker Widget - jQuery UI API Documentation
An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ohhh, that’s not in the docs. Thanks!
There is an
altInputClass
option that precisely targets the problem you’re having. See https://jsfiddle.net/chmln/uqt4qq1a/