Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Fix for issue #3875 #3876

Closed
wants to merge 1 commit into from
Closed

Conversation

robbaman
Copy link

Issue: #3875

Detect invalid date using the method proposed in this SO topic:

http://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript

…rser will make it return an invalid date
@@ -125,7 +125,7 @@ angular.module('ui.bootstrap.dateparser', [])

if ( results && results.length ) {
var fields, dt;
if (baseDate) {
if (baseDate && Object.prototype.toString.call(baseDate) === "[object Date]" && !isNaN(baseDate.getTime())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use angular.isDate to check if it is a date instead of the toString call?

@wesleycho
Copy link
Contributor

This is a duplicate of #3759.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants