Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lara120618's avatar

How to format Vue JS DateTime picker input date

I need to make a datetime picker using vue in Laravel and I found this one https://github.com/mariomka/vue-datetime. It's quite nice.

The problem is that when the data is sent to the server, Carbon\Carbon cries out saying Unexpected data found.Trailing data and InvalidArgumentException.

I suspect it's beacuase of the datetime format thats being sent to the back-end.

The current formt that is sent looks like this 2019-12-26T18:09:00.000Z, JavaScript ISO 8601 standard or something.

Anyone know how to fix this?

0 likes
1 reply
manjumjn's avatar
manjumjn
Best Answer
Level 1

Use momentjs and format it before sending from vuejs as date string. Then you can simply parse using carbon or use createFormat

Please or to participate in this conversation.