summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/date-stringify.ts
diff options
context:
space:
mode:
authorha-dai <contact@haradai.net>2017-11-27 03:41:47 +0900
committerha-dai <contact@haradai.net>2017-11-27 03:41:47 +0900
commit6c75bc6d5188cbbf80fe1086fa0e8828f4edb873 (patch)
tree3ffedcc3a06e53269e92d2990cf0b3bb247ac04a /src/web/app/common/scripts/date-stringify.ts
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
parentUpdate dependencies :rocket: (diff)
downloadmisskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.tar.gz
misskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.tar.bz2
misskey-6c75bc6d5188cbbf80fe1086fa0e8828f4edb873.zip
Merge branch 'master' of github.com:syuilo/misskey
Diffstat (limited to 'src/web/app/common/scripts/date-stringify.ts')
-rw-r--r--src/web/app/common/scripts/date-stringify.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/date-stringify.ts b/src/web/app/common/scripts/date-stringify.ts
new file mode 100644
index 0000000000..e51de8833d
--- /dev/null
+++ b/src/web/app/common/scripts/date-stringify.ts
@@ -0,0 +1,13 @@
+export default date => {
+ if (typeof date == 'string') date = new Date(date);
+ return (
+ date.getFullYear() + '年' +
+ (date.getMonth() + 1) + '月' +
+ date.getDate() + '日' +
+ ' ' +
+ date.getHours() + '時' +
+ date.getMinutes() + '分' +
+ ' ' +
+ `(${['日', '月', '火', '水', '木', '金', '土'][date.getDay()]})`
+ );
+};