flatpickr + javascript in shortpants. no trousers for them anymore

please, how can this 4 lines be written in 2 lines?

$("#display_from").val(res.display_from);
$("#display_to").val(res.display_to);
flatpickr("#display_from", flatpickrconfig);
flatpickr("#display_to", flatpickrconfig);

dumbbot gave me this:

$("#display_from").val(res.display_from).flatpickr(flatpickrconfig);
$("#display_to").val(res.display_to).flatpickr(flatpickrconfig);

which does not work obviously:

Uncaught TypeError: $(...).val(...).flatpickr is not a function

please anyone, i'm repeating this same 4 liners all over the place. they already making me sick. someone help me cut their pants.



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept