Skip to content

Commit

Permalink
Fixed formatting param issues. Added comments documenting use of stri…
Browse files Browse the repository at this point in the history
…ng offset for twoDigitYearMax.
  • Loading branch information
InfinitiesLoop committed Jun 9, 2010
1 parent 72df551 commit 08eb8f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -325,7 +325,9 @@ jQuery.cultures['default'] = {
{"name":"A.D.","start":null,"offset":0}
],
// when a two digit year is given, it will never be parsed as a four digit
// year great than this year (in the appropriate era for the culture)
// year greater than this year (in the appropriate era for the culture)
// Set it as a full year (e.g. 2029) or use an offset format starting from
// the current year: "+19" would correspond to 2029 if the current year 2010.
twoDigitYearMax: 2029,
// set of predefined date and time patterns used by the culture
// these represent the format someone in this culture would expect
Expand Down
21 changes: 14 additions & 7 deletions jquery.glob.js
Expand Up @@ -169,13 +169,18 @@ $.extend({
culture = $.findClosestCulture( culture );

var date;
if ( formats && formats.length ) {
for ( var i = 1, l = formats.length; i < l; i++ ) {
var format = formats[ i ];
if ( format ) {
date = parseExact( value, format, cultureInfo );
if ( date ) {
break;
if ( formats ) {
if ( typeof formats === "string" ) {
formats = [ formats ];
}
if ( formats.length ) {
for ( var i = 0, l = formats.length; i < l; i++ ) {
var format = formats[ i ];
if ( format ) {
date = parseExact( value, format, culture );
if ( date ) {
break;
}
}
}
}
Expand Down Expand Up @@ -342,6 +347,8 @@ var en = cultures["default"] = cultures.en = $.extend(true, {
],
// when a two digit year is given, it will never be parsed as a four digit
// year greater than this year (in the appropriate era for the culture)
// Set it as a full year (e.g. 2029) or use an offset format starting from
// the current year: "+19" would correspond to 2029 if the current year 2010.
twoDigitYearMax: 2029,
// set of predefined date and time patterns used by the culture
// these represent the format someone in this culture would expect
Expand Down

0 comments on commit 08eb8f4

Please sign in to comment.