import moment from 'moment';

Template.dateCell.helpers({
  'formattedDate': function () {
    // Load the Finnish locale
    moment.locale('fi');

    // Create resident latest activity variable
    var activity = this;

    // Convert latest activity date to 'from now' format
    var activityDateFormatted = moment(activity.activityDate).fromNow();

    return activityDateFormatted;
  }
});

import moment from 'moment';

Template.dateCell.helpers({
  'formattedDate': function () {
    // Get client locale
    const clientLocale = TAPi18n.getLanguage();

    // Load the client locale into Moment
    moment.locale(clientLocale);

    // Create resident latest activity variable
    var activity = this;

    // Convert latest activity date to 'from now' format
    var activityDateFormatted = moment(activity.activityDate).fromNow();

    return activityDateFormatted;
  }
});

Use client locale for date format
Use client locale for date format
