diff --git a/src/components/rangeselector/get_update_object.js b/src/components/rangeselector/get_update_object.js index 31f8e7d5eea..cfb2f0915c7 100644 --- a/src/components/rangeselector/get_update_object.js +++ b/src/components/rangeselector/get_update_object.js @@ -1,7 +1,7 @@ 'use strict'; var d3Time = require('d3-time'); -var beginCap = require('../../lib').beginCap; +var titleCase = require('../../lib').titleCase; module.exports = function getUpdateObject(axisLayout, buttonLayout) { var axName = axisLayout._name; @@ -24,7 +24,7 @@ function getXRange(axisLayout, buttonLayout) { var base = new Date(axisLayout.r2l(currentRange[1])); var step = buttonLayout.step; - var utcStep = d3Time['utc' + beginCap(step)]; + var utcStep = d3Time['utc' + titleCase(step)]; var count = buttonLayout.count; var range0; diff --git a/src/lib/index.js b/src/lib/index.js index 7b43f2a0728..6fac1ef2552 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -1347,10 +1347,6 @@ lib.bigFont = function(size) { return Math.round(1.2 * size); }; -lib.beginCap = function(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -}; - var firefoxVersion = lib.getFirefoxVersion(); // see https://bugzilla.mozilla.org/show_bug.cgi?id=1684973 var isProblematicFirefox = firefoxVersion !== null && firefoxVersion < 86; diff --git a/src/plots/geo/geo.js b/src/plots/geo/geo.js index 2b7104f0616..2ee4aec5739 100644 --- a/src/plots/geo/geo.js +++ b/src/plots/geo/geo.js @@ -643,7 +643,7 @@ function getProjection(geoLayout) { var projName = constants.projNames[projType]; // uppercase the first letter and add geo to the start of method name - projName = 'geo' + Lib.beginCap(projName); + projName = 'geo' + Lib.titleCase(projName); var projFn = geo[projName] || geoProjection[projName]; var projection = projFn();