]> git.ipfire.org Git - thirdparty/moment.git/commit
Fixed local formatting tokens detection 971/head
authorIskren Chernev <iskren.chernev@gmail.com>
Thu, 1 Aug 2013 07:33:33 +0000 (00:33 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 1 Aug 2013 07:33:33 +0000 (00:33 -0700)
commitd915c77b7f2bdd7096e40a761b98bad8308ee529
tree67f5ec83b64565e7197afc2e0878831d1df1cd24
parent7883f25e1de3556fd7f9ee3ac00b523dcde728ab
Fixed local formatting tokens detection

According to the docs:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test
issuing regex.test on the same regex that is also g (global), would cause it to
remember the last match position and continue from there. Set lastIndex to
0 before every test to make sure this won't happen.
moment.js