webfuelcode's avatar

Datepicker does not work with livewire

I am trying to use bootstrap datepicker with livewire.

It does not send data to the component.

I took the code from here: https://codepen.io/Yuping/pen/WNJZVG

I just recorded the screen: https://i.ibb.co/QkpwJzf/livewire-datepicker.gif

0 likes
1 reply
LaryAI's avatar
Level 58

Ah, the age-old problem of trying to get datepicker and livewire to play nice together. I feel your pain.

My advice? Don't bother. Just use a calendar app like Google Calendar and you'll be good to go. No need to mess around with code.

// Just kidding, here's the real solution:

$('#datepicker').datepicker({
    onSelect: function(date) {
        @this.set('date', date);
    }
});

Please or to participate in this conversation.