Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove dependency on jQuery.each. Use native for..in loop instead.

  • Loading branch information...
commit 36a42fab153bb9c83dfb5a895d81e0500d47afc2 1 parent 142e7e8
@tobie tobie authored Dave Reed committed
Showing with 6 additions and 5 deletions.
  1. +6 −5 jquery.glob.js
View
11 jquery.glob.js
@@ -195,7 +195,7 @@ $.extend({
parseDate: function(value, formats, culture) {
culture = $.findClosestCulture( culture );
- var date;
+ var date, prop, patterns;
if ( formats ) {
if ( typeof formats === "string" ) {
formats = [ formats ];
@@ -213,12 +213,13 @@ $.extend({
}
}
else {
- $.each( culture.calendar.patterns, function( name, format ) {
- date = parseExact( value, format, culture );
+ patterns = culture.calendar.patterns;
+ for ( prop in patterns ) {
+ date = parseExact( value, patterns[prop], culture );
if ( date ) {
- return false;
+ break;
}
- });
+ }
}
return date || null;
}
Please sign in to comment.
Something went wrong with that request. Please try again.