feat: 优化日期选择,字数展示

This commit is contained in:
ethan.chen
2025-08-15 14:39:55 +08:00
parent e8372dab24
commit 7634c0d1d5
3 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, isSameMonth, isToday } from 'date-fns';
import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, isSameMonth, isToday, startOfWeek, endOfWeek } from 'date-fns';
import { zhCN } from 'date-fns/locale';
import { fade, scale } from 'svelte/transition';
@@ -92,8 +92,8 @@
<div class="text-center text-sm text-gray-500 py-1">{day}</div>
{/each}
{#each eachDayOfInterval({
start: startOfMonth(currentMonth),
end: endOfMonth(currentMonth)
start: startOfWeek(startOfMonth(currentMonth), { weekStartsOn: 0 }),
end: endOfWeek(endOfMonth(currentMonth), { weekStartsOn: 0 })
}) as date}
<button
class:text-gray-400={!isSameMonth(date, currentMonth)}

View File

@@ -148,6 +148,7 @@
aria-label="添加备注信息"
></textarea>
</div>
<div class="text-sm text-left text-gray-500">字数:{media.notes?.length || 0}</div>
<div class="flex justify-end gap-3 mt-6">
<button

View File

@@ -1,7 +1,7 @@
/*
* @Date: 2025-05-20 17:59:45
* @LastEditors: 陈子健
* @LastEditTime: 2025-06-23 14:40:15
* @LastEditTime: 2025-08-15 11:20:05
* @FilePath: /my-score/frontend/vite.config.ts
*/
import { defineConfig } from 'vite'
@@ -13,7 +13,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8000',
target: 'http://review.falsita.cn',
changeOrigin: true,
secure: false
}