From 91ec0509fd100ae4318cd9a73d9b00b3941163b8 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Tue, 22 Mar 2016 23:01:46 +0100 Subject: [PATCH] Fix null default value for DateField Closes #988 --- src/javascripts/ng-admin/Crud/field/maDateField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascripts/ng-admin/Crud/field/maDateField.js b/src/javascripts/ng-admin/Crud/field/maDateField.js index f5e84768..91d193b8 100644 --- a/src/javascripts/ng-admin/Crud/field/maDateField.js +++ b/src/javascripts/ng-admin/Crud/field/maDateField.js @@ -13,7 +13,7 @@ export default function maDateField() { link: function(scope, element) { var field = scope.field(); scope.name = field.name(); - scope.rawValue = scope.value == null ? new Date() : (scope.value instanceof Date ? scope.value : new Date(scope.value)); + scope.rawValue = scope.value == null ? null : (scope.value instanceof Date ? scope.value : new Date(scope.value)); scope.$watch('rawValue', function(rawValue) { scope.value = field.parse()(rawValue); });