(str)
| 17 | }; |
| 18 | |
| 19 | let formatDate = function(str) { |
| 20 | |
| 21 | let date = new Date(str); |
| 22 | let months = 'January February March April May June July August September October November December'.split(' '); |
| 23 | let ends = ['th', 'st', 'nd', 'rd', 'th']; |
| 24 | |
| 25 | let y = chalk.bold(date.getFullYear()); |
| 26 | let m = chalk.bold(months[date.getMonth()]); |
| 27 | let d = chalk.bold(date.getDate()); |
| 28 | let e = chalk.bold(ends[d] || 'th'); |
| 29 | let hh = chalk.bold(formatDigits(date.getHours(), 2)); |
| 30 | let mm = chalk.bold(formatDigits(date.getMinutes(), 2)); |
| 31 | let ss = chalk.bold(formatDigits(date.getSeconds(), 2)); |
| 32 | let ms = chalk.bold(formatDigits(date.valueOf() % 1000, 3)); |
| 33 | |
| 34 | return `${m} ${d}${e}, ${y} at ${hh}:${mm}:${ss}.${ms}`; |
| 35 | |
| 36 | }; |
| 37 | |
| 38 | class UserCommand extends Command { |
| 39 |
nothing calls this directly
no test coverage detected