Date format validation #36

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
@adrai

adrai commented Apr 2, 2012

I can't validate Date objects anymore...

What do you think, can this solve the problem?
Instead of checking if input isObject([object Object]), directly check if is [object Date].

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Feb 6, 2013

The relevant part is in format.js:

       if (isString(input)) {
         return input.match(/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/);
       }
-      if (isObject(input)) {
-        return Object.prototype.toString.call(input) === '[object Date]';
-      }
-      return false;
+      return Object.prototype.toString.call(input) === '[object Date]';
     },

Can this be fixed?

adrai commented Feb 6, 2013

The relevant part is in format.js:

       if (isString(input)) {
         return input.match(/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/);
       }
-      if (isObject(input)) {
-        return Object.prototype.toString.call(input) === '[object Date]';
-      }
-      return false;
+      return Object.prototype.toString.call(input) === '[object Date]';
     },

Can this be fixed?

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Mar 14, 2013

@Baggz Can you give some feedback?

adrai commented Mar 14, 2013

@Baggz Can you give some feedback?

@melon

This comment has been minimized.

Show comment
Hide comment
@melon

melon Apr 5, 2013

@adrai I came across the same problem too!Obviously, it's a mistake.

melon commented Apr 5, 2013

@adrai I came across the same problem too!Obviously, it's a mistake.

@Baggz

This comment has been minimized.

Show comment
Hide comment
@Baggz

Baggz Apr 6, 2013

Owner

Can this be fixed?

@adrai Sure, will do.

Owner

Baggz commented Apr 6, 2013

Can this be fixed?

@adrai Sure, will do.

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Apr 6, 2013

Would be really nice so I can delete my fork... :-)

adrai commented Apr 6, 2013

Would be really nice so I can delete my fork... :-)

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Jun 19, 2013

@Baggz what do you plan to do with this issue?

adrai commented Jun 19, 2013

@Baggz what do you plan to do with this issue?

@adrai

This comment has been minimized.

Show comment
Hide comment
@adrai

adrai Jul 9, 2013

@Baggz When you find a couple of minutes, please try to give your opinion to this...

adrai commented Jul 9, 2013

@Baggz When you find a couple of minutes, please try to give your opinion to this...

@tu1ly

This comment has been minimized.

Show comment
Hide comment
@tu1ly

tu1ly Jun 9, 2014

Collaborator

0e5ac6f - sorry it took so long :/

Collaborator

tu1ly commented Jun 9, 2014

0e5ac6f - sorry it took so long :/

@tu1ly tu1ly closed this Jun 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment