MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
Amorymeltzer (talk | contribs) Repo at c695df4: Improve and standardize JSDocs |
Amorymeltzer (talk | contribs) Repo at 10a5542: Don't import methods that collide with PageTriage (T268513) |
||
Line 1,820:
// Allow native Date.prototype methods to be used on Morebits.date objects
Object.getOwnPropertyNames(Date.prototype).forEach(function(func) {
// Exclude methods that collide with PageTriage's Date.js external, which clobbers native Date: [[phab:T268513]]
Morebits.date.prototype[func] = function() {▼
if (['add', 'getDayName', 'getMonthName'].indexOf(func) === -1) {
return this._d[func].apply(this._d, Array.prototype.slice.call(arguments));▼
};▼
▲ return this._d[func].apply(this._d, Array.prototype.slice.call(arguments));
};
});
|