mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:46:16 -08:00
* update dep * Update package.json * update contextmenu * update d.ts * update onVttLoad * build artplayer * update style * --art-theme * update style * update style * update user-select * add getIcon * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * update style * add progress-hover * update mini * update style * update style * update style * update style * update style * update volume * update style * add art-backdrop * update style * update style * update style * update currentLevel * update artplayerPluginControl * update artplayerPluginDanmuku * Update package.json
25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
import path from 'path';
|
|
import { glob } from 'glob';
|
|
|
|
export function formatDate(date) {
|
|
var date = new Date(Number(date));
|
|
var YY = date.getFullYear() + '-';
|
|
var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
|
var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
|
var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
|
|
var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
|
|
var ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
|
return YY + MM + DD + ' ' + hh + mm + ss;
|
|
}
|
|
|
|
export function getProjects() {
|
|
return glob
|
|
.sync('packages/*')
|
|
.filter((item) => !item.endsWith('artplayer-template') && !item.endsWith('artplayer-vitepress'))
|
|
.reduce((result, item) => {
|
|
const name = item.split(/\/|\\/g).pop();
|
|
result[name] = path.resolve(process.cwd(), item);
|
|
return result;
|
|
}, {});
|
|
}
|