From ffac32640a8e6816d47e818d5f88598228b9f546 Mon Sep 17 00:00:00 2001 From: Naz Date: Fri, 15 May 2026 11:25:36 +0800 Subject: [PATCH] Update --- .../Views/HrDashboard/Calendar.cshtml | 172 ++++++++++++++---- .../Views/HrDashboard/HrUserSetting.cshtml | 53 +++--- 2 files changed, 163 insertions(+), 62 deletions(-) diff --git a/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml b/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml index 0268637..322a7e0 100644 --- a/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml +++ b/Areas/OTcalculate/Views/HrDashboard/Calendar.cshtml @@ -115,17 +115,38 @@ -
-
Holidays for Selected State
- +
+
Holiday Schedule
+ +
+ + + + + + + + + + + + + + + +
DateHoliday NameAction
+ {{ formatDate(holiday.holidayDate) }} + {{ holiday.holidayName }} + +
+
+ +
+ +
No Data Available
+
@@ -166,21 +187,52 @@ -
-
-
+
+
+
+ Assigned Weekends +
+ +
+ +
No Data Available
+

Assign states to a weekend above.

+
+ +
-
- {{ day }} -
    -
  • {{ state }}
  • -
+
+ +
+
+ {{ day }} +
+ {{ states.length }} +
+ +
+
+ + {{ state }} + +
+
+ + @*
+
+ + + Flag + + {{ state }} + +
+
*@
-
@@ -202,7 +254,6 @@ selectedDay: "", weekendList: [], stateWeekends: [], - selectAllChecked: false }; }, @@ -217,7 +268,9 @@ computed: { filteredHolidays() { return this.selectedState - ? this.holidayList.filter(h => h.stateId === this.selectedState) + ? this.holidayList + .filter(h => h.stateId === this.selectedState) + .sort((a, b) => new Date(a.holidayDate) - new Date(b.holidayDate)) : []; }, groupedWeekends() { @@ -230,24 +283,22 @@ }); return grouped; }, - filteredHolidays() { - return this.selectedState - ? this.holidayList - .filter(h => h.stateId === this.selectedState) - .sort((a, b) => new Date(a.holidayDate) - new Date(b.holidayDate)) - : []; - } - }, + + selectAllChecked: { - watch: { - selectAllChecked(ckeckedState) { - if (ckeckedState) { - this.selectedStates = this.stateList.map(state => state.stateId); + get() { + return this.stateList.length > 0 && this.selectedStates.length === this.stateList.length; + }, + + set(value) { + if (value) { + // If checked, select all states + this.selectedStates = this.stateList.map(state => state.stateId); + } else { + // If unchecked, clear all states + this.selectedStates = []; + } } - }, - - selectedStates(ckeckedState) { - this.selectAllChecked = ckeckedState.length === this.stateList.length; } }, @@ -289,7 +340,14 @@ }, formatDate(date) { - return new Date(date).toLocaleDateString(); + if (!date) return ''; + const d = new Date(date); + + const day = String(d.getDate()).padStart(2, '0'); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const year = d.getFullYear(); + + return `${day}/${month}/${year}`; }, async updateHoliday() { @@ -414,6 +472,42 @@ } }, + // getStateFlag(stateName) { + // if (!stateName) return ''; + + // const name = stateName.toLowerCase(); + + // Dictionary mapping state names to Wikimedia Commons flag URLs + // const flags = { + // 'johor': 'https:upload.wikimedia.org/wikipedia/commons/5/5a/Flag_of_Johor.svg', + // 'kedah': 'https:upload.wikimedia.org/wikipedia/commons/c/cc/Flag_of_Kedah.svg', + // 'kelantan': 'https:upload.wikimedia.org/wikipedia/commons/6/61/Flag_of_Kelantan.svg', + // 'melaka': 'https:upload.wikimedia.org/wikipedia/commons/0/09/Flag_of_Malacca.svg', + // 'malacca': 'https:upload.wikimedia.org/wikipedia/commons/0/09/Flag_of_Malacca.svg', + // 'negeri sembilan': 'https:upload.wikimedia.org/wikipedia/commons/d/db/Flag_of_Negeri_Sembilan.svg', + // 'pahang': 'https:upload.wikimedia.org/wikipedia/commons/a/aa/Flag_of_Pahang.svg', + // 'penang': 'https:upload.wikimedia.org/wikipedia/commons/d/d4/Flag_of_Penang_%28Malaysia%29.svg', + // 'pulau pinang': 'https:upload.wikimedia.org/wikipedia/commons/d/d4/Flag_of_Penang_%28Malaysia%29.svg', + // 'perak': 'https:upload.wikimedia.org/wikipedia/commons/8/87/Flag_of_Perak.svg', + // 'perlis': 'https:upload.wikimedia.org/wikipedia/commons/a/aa/Flag_of_Perlis.svg', + // 'sabah': 'https:upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Sabah.svg', + // 'sarawak': 'https:upload.wikimedia.org/wikipedia/commons/7/7e/Flag_of_Sarawak.svg', + // 'selangor': 'https:upload.wikimedia.org/wikipedia/commons/0/0c/Flag_of_Selangor.svg', + // 'terengganu': 'https:upload.wikimedia.org/wikipedia/commons/6/6b/Flag_of_Terengganu.svg', + // 'kuala lumpur': 'https:upload.wikimedia.org/wikipedia/commons/6/64/Flag_of_Kuala_Lumpur%2C_Malaysia.svg', + // 'labuan': 'https:upload.wikimedia.org/wikipedia/commons/6/69/Flag_of_Labuan.svg', + // 'putrajaya': 'https:upload.wikimedia.org/wikipedia/commons/9/9f/Flag_of_Putrajaya.svg' + // }; + + // for (let key in flags) { + // if (name.includes(key)) { + // return flags[key]; + // } + // } + + // return 'https:flagcdn.com/w40/my.png'; + // }, + clearForm() { this.selectedDate = ''; this.selectedStates = []; diff --git a/Areas/OTcalculate/Views/HrDashboard/HrUserSetting.cshtml b/Areas/OTcalculate/Views/HrDashboard/HrUserSetting.cshtml index ee18a09..183d03b 100644 --- a/Areas/OTcalculate/Views/HrDashboard/HrUserSetting.cshtml +++ b/Areas/OTcalculate/Views/HrDashboard/HrUserSetting.cshtml @@ -6,15 +6,13 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @@ -223,37 +221,46 @@
-
-
- - + +@* Table Approval Name *@ +
+
+
+ - - - + + + - + - - - - + + +
No.Approval NameActionNo.Approval NameAction
No approval flows found. + + No Approval Flows Found +

Create a new flow above to get started.

+
{{ index + 1 }}{{ flow.approvalName }} - - + +
{{ index + 1 }}{{ flow.approvalName }} +
+ + + +
-