Son CV dans un terminal web en Javascript! https://terminal-cv.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terminal-cv/node_modules/core-js/modules/es.date.set-year.js

21 lines
674 B

1 year ago
'use strict';
var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var DatePrototype = Date.prototype;
var getTime = uncurryThis(DatePrototype.getTime);
var setFullYear = uncurryThis(DatePrototype.setFullYear);
// `Date.prototype.setYear` method
// https://tc39.es/ecma262/#sec-date.prototype.setyear
$({ target: 'Date', proto: true }, {
setYear: function setYear(year) {
// validate
getTime(this);
var yi = toIntegerOrInfinity(year);
var yyyy = 0 <= yi && yi <= 99 ? yi + 1900 : yi;
return setFullYear(this, yyyy);
}
});