Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-date-locale-provider: Error returning falsy value from parseDate #4780

@ghost

Description

Returning eg. null from parseDate function on md-date-locale-provider causes a crash when manually setting a date value of an md-datepicker:

TypeError: Cannot read property 'setHours' of null
    at Object.g [as setDateTimeToMidnight] (angular-material.min.js:9)
    at o.handleInputEvent (angular-material.min.js:9)
    at angular-material.min.js:7
    at angular.min.js:145
    at e (angular.min.js:42)
    at angular.min.js:45

Expected behaviour:
Setting null marks the md-datepicker input as invalid.

Workaround:
Return new Date(NaN)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions