MCPcopy
hub / github.com/feiyu563/PrometheusAlert / set$1

Function set$1

static/plugins/chart.js/Chart.bundle.js:15518–15527  ·  view source on GitHub ↗
(mom, unit, value)

Source from the content-addressed store, hash-verified

15516 }
15517
15518 function set$1 (mom, unit, value) {
15519 if (mom.isValid() && !isNaN(value)) {
15520 if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
15521 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
15522 }
15523 else {
15524 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
15525 }
15526 }
15527 }
15528
15529 // MOMENTS
15530

Callers 2

makeGetSetFunction · 0.85
addSubtractFunction · 0.85

Calls 2

isLeapYearFunction · 0.85
daysInMonthFunction · 0.85

Tested by

no test coverage detected