I used to format my dates in the view. But now when I make an ajax request to the same data, this is what I do in the controller:
Code: Select all
public function postDispatch() {
if($this->getRequest()->isXmlHttpRequest()) {
$this->_helper->json($this->view->getVars(), null, true);
}
}My guess is to format it in the model, but I don't have a clue on how to do this properly.
Any suggestions?