Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

cal badge

node v10.24.1
version: 0.0.0
endpointsharetweet
/* * USAGE * */ exports.endpoint = async function (req, res) { try { const [month, day, year] = (new Date).toLocaleDateString('en-US', { timeZone: req.url.replace('/', '') || undefined }).split('/') send(res, { subject: year, status: (month + '-' + day), color: 'blue' }) } catch (e) { if (e instanceof RangeError) { send(res, { subject: 'cal badge', status: 'unknown timezone', color: 'grey' }) } else { send(res, { subject: 'cal badge', status: e.toString(), color: 'grey' }) } } } const send = (res, json) => res.end(JSON.stringify(json, null, 2))
Loading…

no comments

    sign in to comment