Comparing two dates

this is my html:
{{#if userDatenum}}

ok »

          <br><br><p id="jumbotron">

    <a href="{{pathFor 'numbers'}}" class="btn btn-primary btn-lg" role="button">
                {{_ "modify"}} &raquo;

my helpers:
Helpers.userDatenum = function() {
var t1 = moment(new Date().toDate());
var t2 = “”;
if(Meteor.user() && Meteor.user().profile) {
datenum = (Meteor.user().profile.datenum);
var t2 = moment(datenum.toDate());
if (moment(t1).isSame(t2),year) {
return true;
Not working :Anyone knows if I missed something.
Help will be gladly appreciated.

Hmm, maybe you need to put year in quotes?

moment(‘2010-10-20’).isSame(‘2010-01-01’, ‘year’); // true (from moment.js docs)

I noticed you’ve used the old way of constructing helpers.

Try this, the new meteor way, meteor guide:


I hope this helps.