Skip to content

Commit

Permalink
This fixes issue # 88.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Williams committed Aug 11, 2015
1 parent 901a77c commit c4348c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions public/javascripts/controllers/farmer-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion public/partials/membership_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3 class="white">Membership</h3>
<div flex layout="row">
<md-icon class="no-margin" md-svg-icon="/images/icons/icons_farmer_active.svg"></md-icon>
<div layout-align="center" style="text-align: center;" layout="column" ng-class="{'md-offset': 1}">
Active
{{isActive(memberships[0].mi_expiration.split("T")[0])? "Active" : 'Inactive'}}

This comment has been minimized.

Copy link
@matjames007

matjames007 Aug 11, 2015

Contributor

Hey @nick22891 try not to do the .split('T'). Use the moments library that is already a part of the application to parse the ISO-8601 date. If you ignore the timezone parts the application will function incorrectly.

<div class="label">Status</div>
</div>
</div>
Expand Down

0 comments on commit c4348c5

Please sign in to comment.