Skip to content

Commit

Permalink
fix failing tests by ensuring that *all* occurrences are replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Feb 20, 2012
1 parent 7c766e0 commit 65ac913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
return format(date);
}
var
chars = format.replace('~', '~T').replace('%%', '~P') + '%',
chars = format.replace(/~/g, '~T').replace(/%%/g, '~P') + '%',
chr, dir = '', idx = 0, len = chars.length, output = '', prev;

while (idx < len) {
Expand Down Expand Up @@ -93,7 +93,7 @@
}
prev = chr;
}
return output.replace('~P', '%').replace('~T', '~');
return output.replace(/~P/g, '%').replace(/~T/g, '~');
};

// Defaults.
Expand Down

0 comments on commit 65ac913

Please sign in to comment.