summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/date-stringify.ts
blob: 2b8e5255679ca8a3de97308501d7e5c8638ab227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export default date => {
	if (typeof date == 'string') date = new Date(date);
	return (
		date.getFullYear()    + '%i18n:common.date.full-year%' +
		(date.getMonth() + 1) + '%i18n:common.date.month%' +
		date.getDate()        + '%i18n:common.date.day%' +
		' ' +
		date.getHours()       + '%i18n:common.date.hours%' +
		date.getMinutes()     + '%i18n:common.date.minutes%' +
		' ' +
		`(${['日', '月', '火', '水', '木', '金', '土'][date.getDay()]})`
	);
};