Skip to content
Advertisement

get start day of week and end day fullCalendar

I´m traying to get actual week with fullCalendar plugin in laravel 5.8. I need get it, to send this date to controller and to do a query with this date.

In my script.js i have a listener click but change my view to week and in this view in title put current week in this format:

JavaScript

i want to get firts day of week and last day of week. Also i´m traying with

JavaScript

but returned me:

JavaScript

because currentData return empty array… But i´m instaciate my calendar so:

JavaScript

and i have all my events from DB in my calendar… I don´t understand why i can´t use my object to use startOf and endOf.

I don´t know i´m doing well my logic, maybe i should to do this to other form. How can i get current week? and even i want show next or last week that i can get this week ok.

Thanks so much for help, and sorry for my english i hope that you can understand me.

Advertisement

Answer

with this function, i´m able to get week´s days

JavaScript
Advertisement