(value)
| 637 | } |
| 638 | |
| 639 | function formatDate(value) { |
| 640 | if (!value) return '-'; |
| 641 | let ts = value; |
| 642 | if (typeof value === 'string') { |
| 643 | const parsed = Date.parse(value); |
| 644 | if (!Number.isNaN(parsed)) ts = parsed; |
| 645 | } |
| 646 | if (typeof ts === 'number') { |
| 647 | if (ts < 1000000000000) ts = ts * 1000; |
| 648 | const d = new Date(ts); |
| 649 | if (!Number.isNaN(d.getTime())) return d.toLocaleString(); |
| 650 | } |
| 651 | return '-'; |
| 652 | } |
| 653 | |
| 654 | function getExt(name) { |
| 655 | const idx = name.lastIndexOf('.'); |