1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-17 16:18:27 +09:00
cherrypick/src/web/app/common/scripts/date-stringify.js

14 lines
351 B
JavaScript
Raw Normal View History

2017-02-18 10:52:51 +09:00
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()]})`
);
};