From 52f9ae7ea17ad0ce05a65002124f7c5ee7d24e8d Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Wed, 10 Jan 2024 14:42:58 -0700 Subject: [PATCH] fixed for real. --- MapProfile/FuellyMappers.cs | 2 +- Views/Vehicle/_CostMakeUpReport.cshtml | 4 +++- Views/Vehicle/_GasCostByMonthReport.cshtml | 4 +++- Views/Vehicle/_ReminderMakeUpReport.cshtml | 4 +++- wwwroot/css/site.css | 6 ++++++ wwwroot/js/collisionrecord.js | 10 ++-------- wwwroot/js/gasrecord.js | 10 ++-------- wwwroot/js/reminderrecord.js | 5 +---- wwwroot/js/servicerecord.js | 10 ++-------- wwwroot/js/shared.js | 15 +++++++++++++++ wwwroot/js/taxrecord.js | 10 ++-------- wwwroot/js/upgraderecord.js | 10 ++-------- wwwroot/js/vehicle.js | 9 ++------- 13 files changed, 44 insertions(+), 55 deletions(-) diff --git a/MapProfile/FuellyMappers.cs b/MapProfile/FuellyMappers.cs index 811da33..abbf467 100644 --- a/MapProfile/FuellyMappers.cs +++ b/MapProfile/FuellyMappers.cs @@ -9,7 +9,7 @@ namespace CarCareTracker.MapProfile { Map(m => m.Date).Name(["date", "fuelup_date"]); Map(m => m.Odometer).Name(["odometer"]); - Map(m => m.FuelConsumed).Name(["gallons", "liters", "litres", "consumption", "fuelconsumed"]); + Map(m => m.FuelConsumed).Name(["gallons", "liters", "litres", "consumption", "quantity"]); Map(m => m.Cost).Name(["cost", "total cost", "totalcost", "total price"]); Map(m => m.Notes).Name("notes", "note"); Map(m => m.Price).Name(["price"]); diff --git a/Views/Vehicle/_CostMakeUpReport.cshtml b/Views/Vehicle/_CostMakeUpReport.cshtml index 051be18..2b92678 100644 --- a/Views/Vehicle/_CostMakeUpReport.cshtml +++ b/Views/Vehicle/_CostMakeUpReport.cshtml @@ -45,5 +45,7 @@ } else { -

No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.

+
+

No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.

+
} diff --git a/Views/Vehicle/_GasCostByMonthReport.cshtml b/Views/Vehicle/_GasCostByMonthReport.cshtml index bcca022..8221ec6 100644 --- a/Views/Vehicle/_GasCostByMonthReport.cshtml +++ b/Views/Vehicle/_GasCostByMonthReport.cshtml @@ -52,5 +52,7 @@ } else { -

No data found, insert/select some data to see visualizations here.

+
+

No data found, insert/select some data to see visualizations here.

+
} \ No newline at end of file diff --git a/Views/Vehicle/_ReminderMakeUpReport.cshtml b/Views/Vehicle/_ReminderMakeUpReport.cshtml index 00100bf..2c42e6e 100644 --- a/Views/Vehicle/_ReminderMakeUpReport.cshtml +++ b/Views/Vehicle/_ReminderMakeUpReport.cshtml @@ -44,5 +44,7 @@ } else { -

No data found, create reminders to see visualizations here.

+
+

No data found, create reminders to see visualizations here.

+
} diff --git a/wwwroot/css/site.css b/wwwroot/css/site.css index 1d00d53..0f9aa06 100644 --- a/wwwroot/css/site.css +++ b/wwwroot/css/site.css @@ -53,6 +53,12 @@ html { td { color: #000 !important; } + td.col-1{ + width:10%; + } + th.col-1 { + width: 10%; + } th { color: #000 !important; } diff --git a/wwwroot/js/collisionrecord.js b/wwwroot/js/collisionrecord.js index fd1dc72..96542eb 100644 --- a/wwwroot/js/collisionrecord.js +++ b/wwwroot/js/collisionrecord.js @@ -3,10 +3,7 @@ if (data) { $("#collisionRecordModalContent").html(data); //initiate datepicker - $('#collisionRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#collisionRecordDate')); $('#collisionRecordModal').modal('show'); } }); @@ -16,10 +13,7 @@ function showEditCollisionRecordModal(collisionRecordId) { if (data) { $("#collisionRecordModalContent").html(data); //initiate datepicker - $('#collisionRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#collisionRecordDate')); $('#collisionRecordModal').modal('show'); } }); diff --git a/wwwroot/js/gasrecord.js b/wwwroot/js/gasrecord.js index 693ccdb..178d41b 100644 --- a/wwwroot/js/gasrecord.js +++ b/wwwroot/js/gasrecord.js @@ -3,10 +3,7 @@ if (data) { $("#gasRecordModalContent").html(data); //initiate datepicker - $('#gasRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#gasRecordDate')); $('#gasRecordModal').modal('show'); } }); @@ -16,10 +13,7 @@ function showEditGasRecordModal(gasRecordId) { if (data) { $("#gasRecordModalContent").html(data); //initiate datepicker - $('#gasRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#gasRecordDate')); $('#gasRecordModal').modal('show'); } }); diff --git a/wwwroot/js/reminderrecord.js b/wwwroot/js/reminderrecord.js index 0d5b7a4..4a0375f 100644 --- a/wwwroot/js/reminderrecord.js +++ b/wwwroot/js/reminderrecord.js @@ -2,10 +2,7 @@ $.get(`/Vehicle/GetReminderRecordForEditById?reminderRecordId=${reminderId}`, function (data) { if (data) { $("#reminderRecordModalContent").html(data); - $('#reminderDate').datepicker({ - startDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#reminderDate'), true); $("#reminderRecordModal").modal("show"); } }); diff --git a/wwwroot/js/servicerecord.js b/wwwroot/js/servicerecord.js index 7b8c7d6..3c99676 100644 --- a/wwwroot/js/servicerecord.js +++ b/wwwroot/js/servicerecord.js @@ -3,10 +3,7 @@ if (data) { $("#serviceRecordModalContent").html(data); //initiate datepicker - $('#serviceRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#serviceRecordDate')); $('#serviceRecordModal').modal('show'); } }); @@ -16,10 +13,7 @@ function showEditServiceRecordModal(serviceRecordId) { if (data) { $("#serviceRecordModalContent").html(data); //initiate datepicker - $('#serviceRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#serviceRecordDate')); $('#serviceRecordModal').modal('show'); } }); diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index 50efb4d..53d6909 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -115,4 +115,19 @@ function isValidMoney(input) { const euRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}(\.?\d{3})?(,\d{1,3}?)?\)?$/; const usRegex = /^\$?(?=\(.*\)|[^()]*$)\(?\d{1,3}(,?\d{3})?(\.\d{1,3}?)?\)?$/; return (euRegex.test(input) || usRegex.test(input)); +} +function initDatePicker(input, futureOnly) { + if (futureOnly) { + input.datepicker({ + startDate: "+0d", + format: getShortDatePattern().pattern, + autoclose: true + }); + } else { + input.datepicker({ + endDate: "+0d", + format: getShortDatePattern().pattern, + autoclose: true + }); + } } \ No newline at end of file diff --git a/wwwroot/js/taxrecord.js b/wwwroot/js/taxrecord.js index 313fbab..39252ff 100644 --- a/wwwroot/js/taxrecord.js +++ b/wwwroot/js/taxrecord.js @@ -3,10 +3,7 @@ if (data) { $("#taxRecordModalContent").html(data); //initiate datepicker - $('#taxRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#taxRecordDate')); $('#taxRecordModal').modal('show'); } }); @@ -16,10 +13,7 @@ function showEditTaxRecordModal(taxRecordId) { if (data) { $("#taxRecordModalContent").html(data); //initiate datepicker - $('#taxRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#taxRecordDate')); $('#taxRecordModal').modal('show'); } }); diff --git a/wwwroot/js/upgraderecord.js b/wwwroot/js/upgraderecord.js index 34f87b6..51fe434 100644 --- a/wwwroot/js/upgraderecord.js +++ b/wwwroot/js/upgraderecord.js @@ -3,10 +3,7 @@ if (data) { $("#upgradeRecordModalContent").html(data); //initiate datepicker - $('#upgradeRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#upgradeRecordDate')); $('#upgradeRecordModal').modal('show'); } }); @@ -16,10 +13,7 @@ function showEditUpgradeRecordModal(upgradeRecordId) { if (data) { $("#upgradeRecordModalContent").html(data); //initiate datepicker - $('#upgradeRecordDate').datepicker({ - endDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#upgradeRecordDate')); $('#upgradeRecordModal').modal('show'); } }); diff --git a/wwwroot/js/vehicle.js b/wwwroot/js/vehicle.js index b4c76dd..d0ed3e8 100644 --- a/wwwroot/js/vehicle.js +++ b/wwwroot/js/vehicle.js @@ -197,18 +197,13 @@ function showAddReminderModal(reminderModalInput) { if (reminderModalInput != undefined) { $.post('/Vehicle/GetAddReminderRecordPartialView', {reminderModel: reminderModalInput}, function (data) { $("#reminderRecordModalContent").html(data); - $('#reminderDate').datepicker({ - startDate: "+0d" - }); + initDatePicker($('#reminderDate'), true); $("#reminderRecordModal").modal("show"); }); } else { $.post('/Vehicle/GetAddReminderRecordPartialView', function (data) { $("#reminderRecordModalContent").html(data); - $('#reminderDate').datepicker({ - startDate: "+0d", - format: getShortDatePattern().pattern - }); + initDatePicker($('#reminderDate'), true); $("#reminderRecordModal").modal("show"); }); }