|
@@ -53,9 +53,8 @@ export function getStaticUrl(url) {
|
|
|
|
|
|
/************* 将时间格式化成 年月+日 ***********/
|
|
/************* 将时间格式化成 年月+日 ***********/
|
|
export function formatDateToYearMonthDay(dateStr) {
|
|
export function formatDateToYearMonthDay(dateStr) {
|
|
- let date = new Date(dateStr);
|
|
|
|
- let dataStr1 =
|
|
|
|
- `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`
|
|
|
|
|
|
+ let date = new Date(dateStr.replace(/-/g, '/'));
|
|
|
|
+ let dataStr1 = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`
|
|
const yearMonth = dataStr1.substring(0, 7); // "2025-06"
|
|
const yearMonth = dataStr1.substring(0, 7); // "2025-06"
|
|
const day = dataStr1.substring(8); // "01"
|
|
const day = dataStr1.substring(8); // "01"
|
|
return [yearMonth, day]
|
|
return [yearMonth, day]
|