Permalink
Browse files

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

  • Loading branch information...
1 parent 142e7e8 commit 36a42fab153bb9c83dfb5a895d81e0500d47afc2 @tobie tobie committed with Dave Reed Jun 13, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −5 jquery.glob.js
View
@@ -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;
}

0 comments on commit 36a42fa

Please sign in to comment.