]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[misc] Remove stray second arg from `parseFloat` (#5277)
authorCameron Chamberlain <git@camjc.com>
Thu, 23 Apr 2020 16:07:27 +0000 (02:07 +1000)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 16:07:27 +0000 (19:07 +0300)
Looks like someone was thinking of parseInt which takes a `radix` param.
In parseFloat there should be one argument only.

src/lib/units/timestamp.js

index a49e1e4b852e1c01a04c8655534e9e74947e7cc1..50c6b87fe176b1b7ddea3b21675e162f86023b14 100644 (file)
@@ -13,7 +13,7 @@ addFormatToken('x', 0, 0, 'valueOf');
 addRegexToken('x', matchSigned);
 addRegexToken('X', matchTimestamp);
 addParseToken('X', function (input, array, config) {
-    config._d = new Date(parseFloat(input, 10) * 1000);
+    config._d = new Date(parseFloat(input) * 1000);
 });
 addParseToken('x', function (input, array, config) {
     config._d = new Date(toInt(input));