monkeeShark/src/web/app/common/scripts/date-stringify.js
2017-02-22 16:32:46 +09:00

13 lines
361 B
JavaScript

module.exports = date => {
if (typeof date == 'string') date = new Date(date);
return (
date.getFullYear() + '年' +
(date.getMonth() + 1) + '月' +
date.getDate() + '日' +
' ' +
date.getHours() + '時' +
date.getMinutes() + '分' +
' ' +
`(${['日', '月', '火', '水', '木', '金', '土'][date.getDay()]})`
);
};