Hi my first time here asking a stupid question. :) I'm building a simple site where you can add edit delete tasks to do and complete them.
I'm done with the most of it, just the complete part is messing with me.
Its a button, then pressed it sends a json put request to the api, that saves it to the mySQL database. The data is the time when completed and just a check. I don't know how to send the time part. :(
$wTasks.delegate('.finish', 'click', function()
{
var $li = $(this).closest('li');
var finito =
{
end_date: date("Y-m-d h:i:s"),
end_check: 1,
}
$.ajax(
{
type: 'PUT',
url: 'api.php/tasks/' + $(this).attr('data-id'),
data: finito,
success: function()
{
}
});
})
date() doesn't work here. And I don't know what to use