Home > Enterprise >  Startdate and Enddate is not working in place of start and end in FullCalendar
Startdate and Enddate is not working in place of start and end in FullCalendar

Time:05-17

I am using react fullCalendar component in my project and my database is SQL server.

fullCalendar needs start,end,fullDay... parameters to render events on it.

The problem here I am facing is in SQL server 'end' is reserved keyword and I can't use column name as end. What will be the solution for this. I tried to use startdate,enddate but it is not rendering. Below is my JSON array.

{id: 12, title: 'Product Proposal', startdate: '2021-03-23T00:25:00.000Z', endDate: '1900-01-01T00:00:00.000Z', …}
{id: 13, title: 'First Meeting', startdate: '2021-03-23T00:35:00.000Z', endDate: '1900-01-01T00:00:00.000Z', …}
{id: 14, title: 'Basic Meeting', startdate: '2021-03-23T00:38:00.000Z', endDate: '2021-04-02T12:00:00.000Z', …}

CodePudding user response:

something like this will work. Please extend with your additional columns etc.

SELECT id, title, startdate AS [start], endDate AS [end] FROM yourtable
  • Related