Skip to content

Commit

Permalink
fix(package): add moment to npm dependencies (#453)
Browse files Browse the repository at this point in the history
* fix(package): add moment to npm dependencies

This commit resolves errors in the master branch by using a npm
installed version of moment instead of the bower installed version on
the server side.

* deps(bower): upgrade angular and fix conflicts

This commit bumps the versions of angular and dependencies found in the
bower modules.  It attempts to fix the breaks on master.
  • Loading branch information
jniles committed May 30, 2016
1 parent 4a4df88 commit a1ad53d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"src"
],
"dependencies": {
"angular": "^1.5.5",
"angular-animate": "^1.5.5",
"angular-sanitize": "^1.5.5",
"angular-messages": "^1.5.5",
"angular": "^1.5.6",
"angular-animate": "^1.5.6",
"angular-sanitize": "^1.5.6",
"angular-messages": "^1.5.6",
"angular-bootstrap": "^1.2.1",
"angular-ui-router": "^0.2.18",
"angular-ui-grid": "^3.1.1",
Expand All @@ -38,10 +38,10 @@
"components-font-awesome": "^4.6.3"
},
"devDependencies": {
"angular-mocks": "^1.5.3"
"angular-mocks": "^1.5.6"
},
"resolutions": {
"angular": "1.5.5",
"Chart.js": "^2.1.3"
"Chart.js": "~2.0.0",
"angular": "1.5.6"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ioredis": "^1.15.1",
"lodash": "^4.13.1",
"mkdirp": "^0.5.1",
"moment": "^2.13.0",
"morgan": "^1.6.1",
"multer": "^1.1.0",
"mysql": "^2.9.0",
Expand Down
18 changes: 9 additions & 9 deletions server/lib/template.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**
* @description
* @description
* This service is a wrapper for the express handlebars library. It sets the required configuration options and provides
* a number of helper methods that are exposed to templates.
* - translate - convert a translation key into the current languages text
* - multiply - multiply two numbers together
* a number of helper methods that are exposed to templates.
* - translate - convert a translation key into the current languages text
* - multiply - multiply two numbers together
* - currency - convert a number into a currency string based on currently selected currency
*
*
* @requires express-handlebars
* @requires numeral
*
*
* @returns {Function} handlebars render method, accepting a template and a context
*/
'use strict';
const exphbs = require('express-handlebars');
const numeral = require('numeral');

// this is very cheeky
const moment = require('./../../client/vendor/moment');
const moment = require('moment');
const en = require('./../../client/i18n/en.json');

const formatDollar = '$0,0.00';
Expand Down Expand Up @@ -78,12 +78,12 @@ function currency(value, currencyKey) {
return numeral(value).format(formatExpression);
}

function date(value) {
function date(value) {
var dateValue = new Date(value);
return dateValue.toDateString();
}

function age(dob) {
function age(dob) {
return moment().diff(dob, 'years');
}

Expand Down

0 comments on commit a1ad53d

Please sign in to comment.