Skip to content

Commit

Permalink
Port unix helper into index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
billimarie committed Oct 2, 2020
1 parent d9a07f4 commit f455cb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions client/templates/sections/current-prosecutors.js

This file was deleted.

8 changes: 8 additions & 0 deletions imports/startup/client/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import moment from 'moment';

import { Attorneys } from '../../api/attorneys.js';

Expand Down Expand Up @@ -50,6 +51,13 @@ Template.currentProsecutors.helpers({
}
});

// Register Date format helper
Template.registerHelper('formatDate', function(unixTimeStamp) {
// js takes dates in milliseconds
var date = new Date(unixTimeStamp * 1000);
return moment(date).format('MM-DD-YYYY');
});

Template.attorneyView.helpers({
Attorneys() {
return Attorneys.find().fetch();
Expand Down

0 comments on commit f455cb9

Please sign in to comment.