Hello, I am putting together an educational application where I have a course calendar. In this project I'm using a jquery calendar, and it uses json to mount dates that have scheduled event.
The plugin ( w3widgets.com/responsive-calendar/ ) uses the following json to mount events in the calendar: / p>
"2014-12-22": { "url" : "link curso" },
"2014-12-26": { "url" : "url do curso"},
"2015-01-12": { "url" : "link deste curso"}
Using my api web application, I was able to generate the following json
{
"data": "29-12-2014",
"url": "gestao-agropecuaria"
},
{
"data": "26-12-2014",
"url": "producao-animal"
},
{
"data": "06-01-2015",
"url": "teste"
}
Below the actionResult method and the method where the query mysql is created for query in the database
public IHttpActionResult Get()
{
var events = new Admin.AppClass.Agenda();
return Ok(events.ListarDatasCalendario());
}
public DataTable ListarDatasCalendario()
{
Mysql mysql = new Mysql();
try
{
return mysql.ExecutarComando(@" SELECT DATE_FORMAT(a.data, '%d-%m-%Y') as data,
c.nome as url
FROM agenda a, cursos c
WHERE a.curso = c.id
ORDER BY data DESC");
}
catch (Exception)
{
throw;
}
}
Can anyone help me with how I can configure json in an acceptable way to work in pluggin?