3 ms·
In JS we can rely on the Date.getDay prototype. Here's the ES6 flavour: weekDay = (dateObj) => ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','
by plugnburn 11y ago
In JS we can rely on the Date.getDay prototype. Here's the ES6 flavour:
weekDay = (dateObj) => ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][dateObj.getDay()]