webstaff: use sub start date as default first pub date for new sub
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 31 May 2017 17:10:28 +0000 (13:10 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 31 May 2017 17:11:28 +0000 (13:11 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/serials/services/core.js

index 615a459..24bc4bb 100644 (file)
@@ -331,6 +331,10 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm
             }
 
             date = new Date(curr_iss.date_published());
+        } else {
+            // starting from scratch, so default the
+            // first publication date to the subscription start date
+            if (!date) date = new Date(sub.start_date());
         }
 
         args.date = date;
@@ -436,7 +440,7 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm
                 $scope.count = options.count;
                 $scope.label = options.label;
                 $scope.save_label = options.save_label;
-                $scope.pubdate = options.date || new Date();
+                $scope.pubdate = options.date;
                 $scope.type = options.type || 'basic';
                 $scope.args = {};