The solution I have come up with requires rebuilding the tasks table, which would mean erasing everyone's session / task data up to this point. If anyone has a better idea, feel free to give it a shot.
Basically, I was going to use the same query that the updateTasks function already uses, but set created_at to NOW( ) when the user is setting the task to completed. However, I realized that if the user wanted to set a task back to pending, the task would no longer have the correct created_at time and would be moved in the planner.
I guess this isn't 100% an issue, but I thought it wouldn't look right. I guess it wouldn't be a huge deal, but I'm not sure what we want.
My solution was to create a new column in our sql table called completed_at, and that date would be used to place the task in the correct date. That way we wouldn't lose our created_at date.
The solution I have come up with requires rebuilding the tasks table, which would mean erasing everyone's session / task data up to this point. If anyone has a better idea, feel free to give it a shot.
Basically, I was going to use the same query that the updateTasks function already uses, but set created_at to NOW( ) when the user is setting the task to completed. However, I realized that if the user wanted to set a task back to pending, the task would no longer have the correct created_at time and would be moved in the planner.
I guess this isn't 100% an issue, but I thought it wouldn't look right. I guess it wouldn't be a huge deal, but I'm not sure what we want.
My solution was to create a new column in our sql table called completed_at, and that date would be used to place the task in the correct date. That way we wouldn't lose our created_at date.