Skip to content

Commit

Permalink
Merge pull request #995 from marmelab/fix_datefield_default_value
Browse files Browse the repository at this point in the history
[RFR] Fix null default value for DateField
  • Loading branch information
fzaninotto committed Mar 22, 2016
2 parents 3586a6a + 91ec050 commit 96b3c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/javascripts/ng-admin/Crud/field/maDateField.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 96b3c90

Please sign in to comment.