At the moment using JavaScript I’m attaching a date to every single object similar to the following.
post.date = getTimestamp(post._id).toDateString();
I can then access ‘date’ from within my template. Is there a nicer way to extract the date?
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.
I’m not sure if this will work in a template, but:
returns an ISODate.
http://mongodb.github.com/node-mongodb-native/api-bson-generated/objectid.html#gettimestamp