Skip to content

Instantly share code, notes, and snippets.

View Date.prototype.toDatetimeLocal.js
// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce
Date.prototype.toDatetimeLocal =
function toDatetimeLocal() {
var
date = this,
ten = function (i) {
return (i < 10 ? '0' : '') + i;
},
YYYY = date.getFullYear(),
MM = ten(date.getMonth() + 1),
@remarkablemark
remarkablemark / README.md
Last active Mar 22, 2021
Classes - ES5 vs ES6
View README.md

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference