From c4348c52864f0e4dca5464d444d383136a2e51cd Mon Sep 17 00:00:00 2001 From: Nick Williams Date: Tue, 11 Aug 2015 11:19:51 -0400 Subject: [PATCH] This fixes issue # 88. --- public/javascripts/controllers/farmer-ctrl.js | 8 ++++++++ public/partials/membership_card.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/javascripts/controllers/farmer-ctrl.js b/public/javascripts/controllers/farmer-ctrl.js index 19b0d41..36aa05c 100644 --- a/public/javascripts/controllers/farmer-ctrl.js +++ b/public/javascripts/controllers/farmer-ctrl.js @@ -90,6 +90,14 @@ angular.module('jasmic.controllers') } }; + $scope.isActive = function(exp_date) { + if(new Date(exp_date) > Date.now()) { + return true; + } else { + return false; + } + }; + /** * Attempts to add new Farm to the farmer object. Assumes the * server will take care of the address creation. diff --git a/public/partials/membership_card.html b/public/partials/membership_card.html index 84426e7..c8b1adc 100644 --- a/public/partials/membership_card.html +++ b/public/partials/membership_card.html @@ -18,7 +18,7 @@

Membership

- Active + {{isActive(memberships[0].mi_expiration.split("T")[0])? "Active" : 'Inactive'}}
Status