Optimized rate editing ui

pull/131/head
tianlinzhong 2022-03-02 16:21:27 +08:00
parent bbacfdabe9
commit b55c4749b7
1 changed files with 6 additions and 0 deletions

View File

@ -199,6 +199,9 @@ app.controller('ModalAddTariffCtrl', function($scope, $timeout, $uibModalInstanc
$uibModalInstance.dismiss('cancel');
};
$scope.add = function(t) {
if (t.peak_type == null || t.price == null){
return false;
}
t.start_time_of_day=t.start_time_of_day.format().slice(11, 19);
t.end_time_of_day=t.end_time_of_day.format().slice(11, 19);
if ($scope.tariff.tariff_type == 'timeofuse') {
@ -283,6 +286,9 @@ app.controller('ModalEditTariffCtrl', function($scope, $timeout, $uibModalInstan
$uibModalInstance.dismiss('cancel');
};
$scope.add = function(t) {
if (t.peak_type == null || t.price == null){
return false;
}
t.start_time_of_day=moment(t.start_time_of_day).format().slice(11, 19);
t.end_time_of_day=moment(t.end_time_of_day).format().slice(11, 19);
if ($scope.tariff.tariff_type == 'timeofuse') {