summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/date-stringify.js
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-18 10:52:51 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-18 10:52:51 +0900
commit6f6723e1c2acd902908a4e0fe22cc8915c21017b (patch)
tree823feeba57708f5d237b2c592a739c80d172acf4 /src/web/app/common/scripts/date-stringify.js
parentMerge branch 'master' into no-ls (diff)
downloadmisskey-6f6723e1c2acd902908a4e0fe22cc8915c21017b.tar.gz
misskey-6f6723e1c2acd902908a4e0fe22cc8915c21017b.tar.bz2
misskey-6f6723e1c2acd902908a4e0fe22cc8915c21017b.zip
:v:
Diffstat (limited to 'src/web/app/common/scripts/date-stringify.js')
-rw-r--r--src/web/app/common/scripts/date-stringify.js13
1 files changed, 13 insertions, 0 deletions
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()]})`
+ );
+};