From 6f6723e1c2acd902908a4e0fe22cc8915c21017b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 10:52:51 +0900 Subject: :v: --- src/web/app/common/scripts/date-stringify.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/web/app/common/scripts/date-stringify.js (limited to 'src/web/app/common/scripts/date-stringify.js') diff --git a/src/web/app/common/scripts/date-stringify.js b/src/web/app/common/scripts/date-stringify.js new file mode 100644 index 0000000000..48e19704d5 --- /dev/null +++ b/src/web/app/common/scripts/date-stringify.js @@ -0,0 +1,13 @@ +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()]})` + ); +}; -- cgit v1.3.1-freya