<commit_before>import { Posts } from '../../collection';

Template.postsForm.helpers({
  postsCollection () {
    return Posts;
  },
  updateInsert () {
    const instance = Template.instance();
    if (instance.data.postItem) {
      return "update";
    }
    else {
      return "insert";
    }
  }
});

Template.registerHelper('formatDate', function(date) {
  return moment(date).format('YYYY-MM-DD HH:mm');
});

AutoForm.addHooks(['postsForm'],{
  onSuccess: function(operation, result, template){
    $('#postInsertModal').modal('hide');
  }
})
<commit_msg>Added calculation of difference from create  to now<commit_after>import { Posts } from '../../collection';

Template.postsForm.helpers({
  postsCollection () {
    return Posts;
  },
  updateInsert () {
    const instance = Template.instance();
    if (instance.data.postItem) {
      return "update";
    }
    else {
      return "insert";
    }
  }
});

Template.registerHelper('formatDate', function(date) {
  return moment(date).format('YYYY-MM-DD HH:mm');
});

Template.registerHelper('calculateFromDate', function(date) {
  // return moment(date).format('YYYY-MM-DD HH:mm');
  return moment(date).from(moment());
});


AutoForm.addHooks(['postsForm'],{
  onSuccess: function(operation, result, template){
    $('#postInsertModal').modal('hide');
  }
})

{'fraction_non_alphanumeric': 0.17687074829931973, 'fraction_numerical': 0.0, 'mean_word_length': 3.7971014492753623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '87822', 'n_tokens_mistral': 411, 'n_tokens_neox': 408, 'n_words': 74}