null checks clean up debug data
This commit is contained in:
@@ -45,31 +45,28 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
$scope.serverTimeNeedsOffsetting = (-serverOffset !== localOffset);
|
||||
}
|
||||
|
||||
//get the current user to see if we can localize this picker
|
||||
userService.getCurrentUser().then(function (user) {
|
||||
const dateFormat = $scope.model.config.pickTime ? "Y-m-d H:i:S" : "Y-m-d";
|
||||
|
||||
const dateFormat = $scope.model.config.pickTime ? "Y-m-d H:i:S" : "Y-m-d";
|
||||
|
||||
// date picker config
|
||||
$scope.datePickerConfig = {
|
||||
enableTime: $scope.model.config.pickTime,
|
||||
dateFormat: dateFormat,
|
||||
time_24hr: true
|
||||
};
|
||||
|
||||
$scope.model.config.language = user.locale;
|
||||
|
||||
setDatePickerVal();
|
||||
// date picker config
|
||||
$scope.datePickerConfig = {
|
||||
enableTime: $scope.model.config.pickTime,
|
||||
dateFormat: dateFormat,
|
||||
time_24hr: true
|
||||
};
|
||||
|
||||
});
|
||||
setDatePickerVal();
|
||||
|
||||
}
|
||||
|
||||
$scope.clearDate = function() {
|
||||
$scope.hasDatetimePickerValue = false;
|
||||
$scope.model.datetimePickerValue = null;
|
||||
$scope.model.value = null;
|
||||
$scope.datePickerForm.datepicker.$setValidity("pickerError", true);
|
||||
if($scope.model) {
|
||||
$scope.model.datetimePickerValue = null;
|
||||
$scope.model.value = null;
|
||||
}
|
||||
if($scope.datePickerForm && $scope.datePickerForm.datepicker) {
|
||||
$scope.datePickerForm.datepicker.$setValidity("pickerError", true);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.datePickerSetup = function(instance) {
|
||||
|
||||
@@ -42,16 +42,5 @@
|
||||
<a href ng-click="clearDate()"><i class="icon-delete"></i><small><localize key="content_removeDate">Clear date</localize></small></a>
|
||||
</p>
|
||||
|
||||
<div style="margin-top: 10px;">
|
||||
<div>
|
||||
<div class="bold">model.value</div>
|
||||
{{model.value}}
|
||||
</div>
|
||||
<div>
|
||||
<div class="bold">Date time picker value</div>
|
||||
{{model.datetimePickerValue}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user