paricafe/src/web/app/common/scripts/date-stringify.js

14 lines
361 B
JavaScript
Raw Normal View History

2017-02-17 19:52:51 -06:00
module.exports = date => {
if (typeof date == 'string') date = new Date(date);
return (
2017-02-22 01:32:46 -06:00
date.getFullYear() + '年' +
(date.getMonth() + 1) + '月' +
date.getDate() + '日' +
2017-02-17 19:52:51 -06:00
' ' +
2017-02-22 01:32:46 -06:00
date.getHours() + '時' +
date.getMinutes() + '分' +
2017-02-17 19:52:51 -06:00
' ' +
`(${['日', '月', '火', '水', '木', '金', '土'][date.getDay()]})`
);
};