From c0b3ad40b408bdd964275ddba0a216007e65bf94 Mon Sep 17 00:00:00 2001 From: MTDES23 Date: Fri, 3 Apr 2026 22:00:24 +0700 Subject: [PATCH 1/2] feat: add holidays app with comprehensive holiday information - Add new holidays app with 30+ holidays from Vietnam, regional, and international - Features tab filtering by holiday type (Vietnam, Regional, International) - Timeline view organized by months for better navigation - Search functionality to find specific holidays - Detailed history and descriptions for each holiday - Responsive design following project design system - Author: mtdes23 --- src/views/holidays/index.vue | 618 +++++++++++++++++++++++++++++++++++ src/views/holidays/meta.ts | 11 + 2 files changed, 629 insertions(+) create mode 100644 src/views/holidays/index.vue create mode 100644 src/views/holidays/meta.ts diff --git a/src/views/holidays/index.vue b/src/views/holidays/index.vue new file mode 100644 index 00000000..eeb1a67e --- /dev/null +++ b/src/views/holidays/index.vue @@ -0,0 +1,618 @@ + + + diff --git a/src/views/holidays/meta.ts b/src/views/holidays/meta.ts new file mode 100644 index 00000000..35645e1d --- /dev/null +++ b/src/views/holidays/meta.ts @@ -0,0 +1,11 @@ +import type { PageMeta } from '@/types/page' + +const meta: PageMeta = { + name: 'Holidays', + description: 'Các ngày lễ trong năm.', + author: 'mtdes23', + facebook: 'https://www.facebook.com/mtdes233/', + category: 'connect', +} + +export default meta From 408fe14a990ca572fe988043006b29b9bd3e7ef7 Mon Sep 17 00:00:00 2001 From: MTDES23 Date: Fri, 3 Apr 2026 22:08:32 +0700 Subject: [PATCH 2/2] fix: resolve type-check errors in holidays app and complete CI compatibility --- src/views/holidays/index.vue | 59 ++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/src/views/holidays/index.vue b/src/views/holidays/index.vue index eeb1a67e..263c2fde 100644 --- a/src/views/holidays/index.vue +++ b/src/views/holidays/index.vue @@ -28,12 +28,16 @@ interface Holiday { month?: number } -const typeLabels: Record = { +const typeLabels: Record = { vietnam: '🇻🇳 Việt Nam', regional: '🏔️ Vùng Miền Việt Nam', international: '🌍 Quốc Tế', } +const getTypeLabel = (type: Holiday['type']): string => typeLabels[type] + +const getMonthName = (month: number): string => monthNames[month - 1] ?? 'Tháng' + const monthNames = [ 'Tháng 1', 'Tháng 2', @@ -394,10 +398,15 @@ const holidays = ref([ }, ]) +interface GroupedMonth { + month: number + holidays: Holiday[] +} + const activeType = ref<'vietnam' | 'regional' | 'international' | 'all'>('all') const searchQuery = ref('') -const groupedHolidays = computed(() => { +const groupedHolidays = computed((): GroupedMonth[] => { let filtered = holidays.value if (activeType.value !== 'all') { @@ -412,27 +421,30 @@ const groupedHolidays = computed(() => { } // Group by month - const grouped: Record = {} + const result: GroupedMonth[] = [] for (let i = 1; i <= 12; i++) { - grouped[i] = [] + result.push({ month: i, holidays: [] }) } filtered.forEach((h) => { - if (h.month) { - grouped[h.month].push(h) + if (h.month != null) { + const group = result.find((g) => g.month === h.month) + if (group) { + group.holidays.push(h) + } } }) // Sort each month's holidays by date - Object.values(grouped).forEach((arr) => { - arr.sort((a, b) => { - const aNum = parseInt(a.date.split('/')[0]) || 0 - const bNum = parseInt(b.date.split('/')[0]) || 0 + result.forEach((group) => { + group.holidays.sort((a, b) => { + const aNum = Number(a.date.split('/')[0]) || 0 + const bNum = Number(b.date.split('/')[0]) || 0 return aNum - bNum }) }) - return grouped + return result.filter((group) => group.holidays.length > 0) }) @@ -441,7 +453,7 @@ const groupedHolidays = computed(() => {
- +

🎉 Các Ngày Lễ Trong Năm @@ -522,26 +534,29 @@ const groupedHolidays = computed(() => {
-
+
-
+

- // {{ monthNames[monthIndex] }} + // {{ getMonthName(monthGroup.month) }}

- {{ month.length }} ngày lễ + {{ monthGroup.holidays.length }} ngày lễ
-
+
@@ -551,7 +566,7 @@ const groupedHolidays = computed(() => {
{{ - typeLabels[holiday.type] + getTypeLabel(holiday.type) }}