Skip to content

Commit

Permalink
Better argument naming and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrunel committed Jan 10, 2019
1 parent 3183b55 commit b76d6b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/adapters/adapter.moment.js
Expand Up @@ -56,10 +56,10 @@ helpers.merge(adapter, moment ? {
return moment.duration(moment(max).diff(moment(min))).as(unit);
},

startOf: function(time, unit, opt) {
startOf: function(time, unit, weekday) {
time = moment(time);
if (unit === 'isoWeek') {
return +time.isoWeekday(opt);
return +time.isoWeekday(weekday);
}
return +time.startOf(unit);
},
Expand Down
2 changes: 1 addition & 1 deletion src/chart.js
Expand Up @@ -31,7 +31,7 @@ Chart.helpers.each(scales, function(scale, type) {
Chart.scaleService.registerScaleType(type, scale, scale._defaults);
});

// Built-in adapters (loaded for side effects)
// Load to register built-in adapters (as side effects)
require('./adapters');

// Loading built-in plugins
Expand Down
2 changes: 2 additions & 0 deletions src/core/core.adapters.js
Expand Up @@ -86,6 +86,8 @@ module.exports._date = {
* Returns start of `unit` for the given `timestamp`.
* @param {number} timestamp - the input timestamp
* @param {Unit} unit - the unit as string
* @param {number} [weekday] - the ISO day of the week with 1 being Monday
* and 7 being Sunday (only needed if param *unit* is `isoWeek`).
* @function
*/
startOf: abstract,
Expand Down

0 comments on commit b76d6b4

Please sign in to comment.