Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
use isAfter() instead of negating isBefore()
Browse files Browse the repository at this point in the history
  • Loading branch information
alee committed Jan 26, 2015
1 parent 71200b4 commit 27df54a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vcweb/core/templates/experimenter/subject-pool-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ <h3 style="display: inline"></h3>
};

model.saveSession = function(session, event) {
if(!moment(session.start_date()).isBefore(session.end_date())){
if (moment(session.start_date()).isAfter(session.end_date())) {
bootbox.alert(
"ERROR: End date cannot be earlier than or same as the start date. Please choose a later end date.",
function() {}
Expand Down Expand Up @@ -441,7 +441,7 @@ <h3 style="display: inline"></h3>

self.selected = ko.observable(false);
self.active = ko.computed( function() {
return (self.pk() == -1 || !(moment(self.end_date()).isBefore()));
return self.pk() == -1 || moment(self.end_date()).isAfter();
});
self.makeEditable = function () {
self.isEditable(true);
Expand Down

0 comments on commit 27df54a

Please sign in to comment.