대시보드와 주간보고 기능 업데이트
This commit is contained in:
@@ -190,7 +190,7 @@
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
|
||||
const { fetchCurrentUser } = useAuth()
|
||||
const { getCurrentWeekInfo } = useWeekCalc()
|
||||
const { getCurrentWeekInfo, getWeekDates } = useWeekCalc()
|
||||
const router = useRouter()
|
||||
|
||||
const currentYear = new Date().getFullYear()
|
||||
@@ -296,19 +296,8 @@ watch(showAggregateModal, (val) => {
|
||||
})
|
||||
|
||||
function getWeekDateRange(year: number, week: number): string {
|
||||
const jan4 = new Date(year, 0, 4)
|
||||
const jan4Day = jan4.getDay() || 7
|
||||
const week1Monday = new Date(jan4)
|
||||
week1Monday.setDate(jan4.getDate() - jan4Day + 1)
|
||||
|
||||
const monday = new Date(week1Monday)
|
||||
monday.setDate(week1Monday.getDate() + (week - 1) * 7)
|
||||
|
||||
const sunday = new Date(monday)
|
||||
sunday.setDate(monday.getDate() + 6)
|
||||
|
||||
const fmt = (d: Date) => `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`
|
||||
return `${fmt(monday)}~${fmt(sunday)}`
|
||||
const weekInfo = getWeekDates(year, week)
|
||||
return `${weekInfo.startDateStr}~${weekInfo.endDateStr}`
|
||||
}
|
||||
|
||||
function formatDate(dateStr: string) {
|
||||
|
||||
Reference in New Issue
Block a user