Edit post works with updating the database and checking the date