diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 04f4b2de..698ef0f9 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -241,11 +241,6 @@ -
- - -
-
+
+ + +
+
diff --git a/app/Views/policy_transaction_endorsement_list.php b/app/Views/policy_transaction_endorsement_list.php index 6f5485cb..59963f43 100644 --- a/app/Views/policy_transaction_endorsement_list.php +++ b/app/Views/policy_transaction_endorsement_list.php @@ -287,7 +287,6 @@ table.dataTable thead th {
- @@ -568,10 +567,24 @@ table.dataTable thead th { maxDate: today // Disallow future dates }); + var month = flatpickr("#month", { + dateFormat: "M/Y", // Format as month and year + allowInput: false, // Disable manual input + }); - var closure_date = flatpickr("#policy_issue_date", { - dateFormat: "d/m/Y", - allowInput: false + var policy_issue_date = flatpickr("#policy_issue_date", { + dateFormat: "d/m/Y", // Format as day-month-year + allowInput: false, // Disable manual input + onChange: function(selectedDates, dateStr, instance) { + // Get the selected date + var selectedDate = new Date(selectedDates[0]); + + // Format the selected date to "M-Y" + var formattedMonth = flatpickr.formatDate(selectedDate, "M/Y"); + + // Set the value of the #month input + month.setDate(formattedMonth); + } }); var install_due_date = flatpickr("#install_due_date", { @@ -579,26 +592,11 @@ table.dataTable thead th { allowInput: false }); - // var start_date = flatpickr("#policy_start_date", { - // dateFormat: "d/m/Y", - // allowInput: false - // }); - - // var end_date = flatpickr("#policy_end_date", { - // dateFormat: "d/m/Y", - // allowInput: false - // }); - var endorse_eff_date = flatpickr("#endorse_eff_date", { dateFormat: "d/m/Y", allowInput: false }); - var month = flatpickr("#month", { - dateFormat: "M/Y", - allowInput: false, - }); - }); function hide_list_show_add() {