Permalink
Browse files

Fix for some non-empty format strings with no number placeholders (e.…

…g. ',')
  • Loading branch information...
therazor committed Jun 7, 2012
1 parent d82247e commit 1452b29fc37d326fab0c752de0f685d5cc03f35b
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/globalize.js
View
@@ -892,10 +892,11 @@ formatDate = function( value, format, culture ) {
}
};
- subpatternContainer.push( subpattern );
+ if ( subpattern !== '' )
+ subpatternContainer.push( subpattern );
if ( !subpatterns.length )
- return textualSubpatterns[0];
+ return textualSubpatterns.length ? textualSubpatterns[0] : '';
var fullPattern = subpatterns.join( '' ),
intDecPatterns = fullPattern.split( '.' ),

0 comments on commit 1452b29

Please sign in to comment.