My backbone collection fetches its models without issue.
The model returns {{=calldate}} in the sql date format. How should I reformat the date from within the model so that the date is readable in the template as rendered by the view? thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Date prettification is a presentation-level activity and shouldn’t be done in the model. Either add the formatting logic directly to your template and/or, preferably, create a formatting helper that you can call from any template to format dates prettily and consistently.
There are many prettification libraries. Here’s one: http://blog.stevenlevithan.com/archives/date-time-format