0

I'm just starting learning Meteor with the official tutorial (https://www.meteor.com/tutorials/blaze/templates).

I want to use the "createdAt" value that we have on the database. Since this value is an instance of Date, I want to print the day of insert using the getDay() function of the Date class.

My question : how to do so :p I mean, can we do it directly on the html file or must we use smth like a function in our .js ?

Thanks for your help :)

Ynnad
  • 303
  • 4
  • 18
  • 1
    Does [this](https://stackoverflow.com/questions/22087907/how-to-format-date-in-meteor-template) answer your question? – David Weldon Jul 01 '15 at 17:15

2 Answers2

0

You have to write a helper function for the template in the js file with some parameters and then call it in the html template {{helperName parameter}}

Guidouil
  • 1,694
  • 2
  • 18
  • 18
  • Thank! Your answer and the example of @David_Weldon make me understand a little more about Meteor. – Ynnad Jul 01 '15 at 19:20
0

Kindly use momentJs as you library.Its very awesome lib for your project

link : http://momentjs.com/

Farid Blaster
  • 974
  • 1
  • 9
  • 23