diff --git a/ReportingServices.API/Controllers/ScrapeDBController.cs b/ReportingServices.API/Controllers/ScrapeDBController.cs index 1f92ba9..e37e45d 100644 --- a/ReportingServices.API/Controllers/ScrapeDBController.cs +++ b/ReportingServices.API/Controllers/ScrapeDBController.cs @@ -61,4 +61,13 @@ public class ScrapeDBController : ControllerBase [HttpGet("GetCurrentHotWORunning")] public List GetCurrentHotWORunning() => _scrapeDBRepository.GetCurrentHotWORunning(); + + [HttpGet("GetScheduledEvents")] + public List GetScheduledEvents(string startDate, string endDate) => _scrapeDBRepository.GetScheduledEvents(startDate, endDate); + + [HttpGet("GetReactorPartChanges")] + public List GetReactorPartChanges(string startDate, string endDate) => _scrapeDBRepository.GetReactorPartChanges(startDate, endDate); + + [HttpGet("GetProjectedPartChanges")] + public List GetProjectedPartChanges(string startDate, string endDate) => _scrapeDBRepository.GetProjectedPartChanges(startDate, endDate); } \ No newline at end of file diff --git a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs index 9fe2171..1294cfb 100644 --- a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs +++ b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using ReportingServices.Shared.Models.PlanningReport; using ReportingServices.Shared.Models.ProductionReport; using ReportingServices.Shared.ViewModels.ProductionReport; @@ -75,6 +76,10 @@ public static class DailyReportHelper Task task5 = null; Task task6 = null; Task> task7 = null; + Task> task8 = null; + Task> task9 = null; + Task> task10 = null; + Task> task11 = null; try { @@ -109,6 +114,10 @@ public static class DailyReportHelper task5 = ApiCaller.GetApi(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.ToString()); task6 = ApiCaller.GetApi(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.AddDays(-7).ToString()); task7 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetCurrentHotWORunning"); + task8 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetReactorPartChanges?startDate=" + currentDateTime.Date.ToString() + "&endDate=" + currentDateTime.ToString()); + task9 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetProjectedPartChanges?startDate=" + currentDateTime.ToString() + "&endDate=" + currentDateTime.Date.AddDays(1).ToString()); + task10 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetReactorPartChanges?startDate=" + report.StartDate.ToString() + "&endDate=" + currentDateTime.ToString()); + task11 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetProjectedPartChanges?startDate=" + currentDateTime.ToString() + "&endDate=" + report.StartDate.AddDays(7).ToString()); } catch (Exception ex) { @@ -166,6 +175,13 @@ public static class DailyReportHelper report.CurrentHotWORunning.Add("R50"); report.CurrentHotWORunning.Sort(); + + report.CompletedDailyPartChanges = task8.Result; + report.ProjectedDailyPartChanges = task9.Result; + + report.CompletedWeeklyPartChanges = task10.Result; + report.ProjectedWeeklyPartChanges = task11.Result; + } catch (Exception ex) { diff --git a/ReportingServices.Shared/Models/PlanningReport/ReactorPSNWORuns.cs b/ReportingServices.Shared/Models/PlanningReport/ReactorPSNWORuns.cs index 1c2102b..e150073 100644 --- a/ReportingServices.Shared/Models/PlanningReport/ReactorPSNWORuns.cs +++ b/ReportingServices.Shared/Models/PlanningReport/ReactorPSNWORuns.cs @@ -8,6 +8,8 @@ public class ReactorPSNWORuns public string REACTOR { get; set; } [JsonPropertyName("PSN")] public string PSN { get; set; } + [JsonPropertyName("WO")] + public string WO { get; set; } [JsonPropertyName("WO_COUNT")] public int WO_COUNT { get; set; } } \ No newline at end of file diff --git a/ReportingServices.Shared/Models/ProductionReport/ManualReportEntries.cs b/ReportingServices.Shared/Models/ProductionReport/ManualReportEntries.cs index a6eaa89..011c442 100644 --- a/ReportingServices.Shared/Models/ProductionReport/ManualReportEntries.cs +++ b/ReportingServices.Shared/Models/ProductionReport/ManualReportEntries.cs @@ -15,6 +15,4 @@ public class ManualReportEntries public int MaintenanceCallOutsDays { get; set; } public int MaintenanceCallOutsNights { get; set; } public string BottleChanges { get; set; } - public string DailyPartChanges { get; set; } - public string WeeklyPartChanges { get; set; } } \ No newline at end of file diff --git a/ReportingServices.Shared/Models/ProductionReport/ScheduledEvent.cs b/ReportingServices.Shared/Models/ProductionReport/ScheduledEvent.cs new file mode 100644 index 0000000..654a1d1 --- /dev/null +++ b/ReportingServices.Shared/Models/ProductionReport/ScheduledEvent.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; + +namespace ReportingServices.Shared.Models.ProductionReport; +public class ScheduledEvent +{ + [JsonPropertyName("REACT_NO")] + public string REACT_NO { get; set; } + [JsonPropertyName("WO_NO")] + public string WO_NO { get; set; } + [JsonPropertyName("PROD_SPEC_ID")] + public string PROD_SPEC_ID { get; set; } + [JsonPropertyName("START_DTM")] + public DateTime START_DTM { get; set; } + [JsonPropertyName("STOP_DTM")] + public DateTime STOP_DTM { get; set; } + [JsonPropertyName("BLOCKOUT")] + public string BLOCKOUT { get; set; } + [JsonPropertyName("BLOCKOUT_TYPE")] + public string BLOCKOUT_TYPE { get; set; } +} diff --git a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs index 37986df..300b7cb 100644 --- a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs +++ b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs @@ -124,10 +124,10 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository SqlCommand cmd = _connection.CreateCommand(); - string query = "SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) FROM RDS " + - "WHERE DATE_OUT BETWEEN @startDate AND @endDate " + - "GROUP BY REACTOR, PROD_SPEC_ID " + - "ORDER BY 1"; + string query = "SELECT REACTOR, PROD_SPEC_ID, WO, COUNT(WO) FROM RDS " + + " WHERE DATE_OUT BETWEEN @startDate AND @endDate " + + "GROUP BY REACTOR, PROD_SPEC_ID, WO " + + "ORDER BY 1"; cmd.CommandText = query; _ = cmd.Parameters.AddWithValue("@startDate", startDate); @@ -140,7 +140,55 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository { REACTOR = reader[0].ToString(), PSN = reader[1].ToString(), - WO_COUNT = int.Parse(reader[2].ToString()) + WO = reader[2].ToString(), + WO_COUNT = int.Parse(reader[3].ToString()) + }); + } + + cmd.Dispose(); + + CloseConnection(); + + return weeklyPartChanges; + } + + public List GetReactorPartChanges(string startDate, string endDate) + { + List weeklyPartChanges = new(); + + OpenConnection(); + + SqlCommand cmd = _connection.CreateCommand(); + + string query = "SELECT REACTOR, PROD_SPEC_ID, WO, COUNT(WO) AS WO_COUNT FROM RDS " + + " WHERE DATE_OUT BETWEEN @startDate AND @endDate " + + " AND REACTOR IN (SELECT REACTOR " + + " FROM (SELECT REACTOR, " + + " COUNT(PROD_SPEC_ID) - 1 AS PCHANGE " + + " FROM (SELECT REACTOR, " + + " PROD_SPEC_ID, " + + " COUNT(WO) AS PSN_COUNT " + + " FROM RDS " + + " WHERE DATE_OUT BETWEEN @startDate AND @endDate " + + " GROUP BY REACTOR, PROD_SPEC_ID) AS t " + + " GROUP BY REACTOR) AS l " + + " WHERE l.PCHANGE > 0) " + + "GROUP BY REACTOR, PROD_SPEC_ID, WO " + + "ORDER BY 1"; + + cmd.CommandText = query; + _ = cmd.Parameters.AddWithValue("@startDate", startDate); + _ = cmd.Parameters.AddWithValue("@endDate", endDate); + + using (SqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + weeklyPartChanges.Add(new ReactorPSNWORuns + { + REACTOR = "R" + reader[0].ToString(), + PSN = reader[1].ToString(), + WO = reader[2].ToString(), + WO_COUNT = int.Parse(reader[3].ToString()) }); } @@ -593,7 +641,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository SqlCommand cmd = _connection.CreateCommand(); - string query = "SELECT REACT_NO " + + string query = "SELECT DISTINCT(REACT_NO) " + " FROM SCHED_DET_NG schd " + "INNER JOIN WO_LOG wlog ON WO = WO_NO " + " WHERE STOP_DTM > SYSDATETIME() " + @@ -615,4 +663,108 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository return lots; } + + public List GetScheduledEvents(string startDate, string endDate) + { + List events = new(); + + OpenConnection(); + + SqlCommand cmd = _connection.CreateCommand(); + + string query = "SELECT REACT_NO, " + + " schd.WO_NO, " + + " PROC_SPEC_ID, " + + " START_DTM, " + + " STOP_DTM, " + + " BLOCKOUT, " + + " BLOCK_OUT_TYPE " + + " FROM SCHED_DET_NG schd " + + "FULL OUTER JOIN WO_STEP step " + + " ON step.WO_NO = schd.WO_NO " + + " WHERE ((STOP_DTM > @startDate AND STOP_DTM < @endDate) " + + " OR (START_DTM > @startDate AND START_DTM < @endDate)) " + + "ORDER BY REACT_NO, START_DTM ASC"; + + cmd.CommandText = query; + _ = cmd.Parameters.AddWithValue("@startDate", startDate); + _ = cmd.Parameters.AddWithValue("@endDate", endDate); + + using (SqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + events.Add(new ScheduledEvent + { + REACT_NO = reader[0].ToString(), + WO_NO = reader[1].ToString(), + PROD_SPEC_ID = reader[2].ToString(), + START_DTM = DateTime.Parse(reader[3].ToString()), + STOP_DTM = DateTime.Parse(reader[4].ToString()), + BLOCKOUT = reader[5].ToString(), + BLOCKOUT_TYPE = reader[6].ToString() + }); + } + + cmd.Dispose(); + + CloseConnection(); + + return events; + } + + public List GetProjectedPartChanges(string startDate, string endDate) + { + List events = new(); + + OpenConnection(); + + SqlCommand cmd = _connection.CreateCommand(); + + string query = "SELECT REACT_NO, " + + " PROC_SPEC_ID, " + + " schd.WO_NO " + + " FROM SCHED_DET_NG schd " + + "FULL OUTER JOIN WO_STEP step " + + " ON step.WO_NO = schd.WO_NO " + + " WHERE ((STOP_DTM > @startDate AND STOP_DTM < @endDate) " + + " OR (START_DTM > @startDate AND START_DTM < @endDate)) " + + " AND BLOCKOUT IS NULL " + + " AND REACT_NO IN (SELECT REACT_NO " + + " FROM (SELECT REACT_NO, " + + " COUNT(PROC_SPEC_ID) - 1 AS PCHANGE " + + " FROM (SELECT REACT_NO, " + + " PROC_SPEC_ID, " + + " COUNT(schd.WO_NO) AS WO_COUNT " + + " FROM SCHED_DET_NG schd " + + " FULL OUTER JOIN WO_STEP step " + + " ON step.WO_NO = schd.WO_NO " + + " WHERE ((STOP_DTM > @startDate AND STOP_DTM < @endDate) " + + " OR (START_DTM > @startDate AND START_DTM < @endDate)) " + + " AND BLOCKOUT IS NULL GROUP BY REACT_NO, PROC_SPEC_ID) AS l " + + " GROUP BY REACT_NO) AS p " + + " WHERE PCHANGE > 0) " + + "ORDER BY REACT_NO"; + + cmd.CommandText = query; + _ = cmd.Parameters.AddWithValue("@startDate", startDate); + _ = cmd.Parameters.AddWithValue("@endDate", endDate); + + using (SqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + events.Add(new ReactorPSNWORuns + { + REACTOR = "R" + reader[0].ToString(), + PSN = reader[1].ToString(), + WO = reader[2].ToString(), + WO_COUNT = 0 + }); + } + + cmd.Dispose(); + + CloseConnection(); + + return events; + } } \ No newline at end of file diff --git a/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs b/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs index 43e9003..4d5a469 100644 --- a/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs +++ b/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs @@ -21,4 +21,7 @@ public interface IScrapeDatabaseRepository public DateTime GetQuarterStartDate(); public List GetCurrentHoldLots(); public List GetCurrentHotWORunning(); + public List GetScheduledEvents(string startDate, string endDate); + public List GetReactorPartChanges(string startDate, string endDate); + public List GetProjectedPartChanges(string startDate, string endDate); } \ No newline at end of file diff --git a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs index 32b1a4c..9fb04b9 100644 --- a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs +++ b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs @@ -1,4 +1,5 @@ using ReportingServices.Shared.HelperClasses; +using ReportingServices.Shared.Models.PlanningReport; using ReportingServices.Shared.Models.ProductionReport; namespace ReportingServices.Shared.ViewModels.ProductionReport; @@ -18,6 +19,10 @@ public class DailyReport public List UnloadTempsByDay { get; set; } public List SLLTools { get; set; } public List CurrentHotWORunning { get; set; } + public List CompletedDailyPartChanges { get; set; } + public List ProjectedDailyPartChanges { get; set; } + public List CompletedWeeklyPartChanges { get; set; } + public List ProjectedWeeklyPartChanges { get; set; } public int NumberOfToolsWaferSize6IN { get; set; } public int NumberOfToolsWaferSize8IN { get; set; } public int NumberOfToolsWaferSize6INScheduled { get; set; } diff --git a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml index 93b888f..e42b799 100644 --- a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml +++ b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml @@ -67,12 +67,9 @@
    @{ int bottleChanges = 0; - int dailyPartChanges = 0; - int weeklyPartChanges = 0; string bottle = ""; - string daily = ""; - string weekly = ""; + if (!string.IsNullOrEmpty(rpt.BottleChanges)) { @@ -80,22 +77,24 @@ bottleChanges = @rpt.BottleChanges.Split(',').Length; } - if (!string.IsNullOrEmpty(rpt.DailyPartChanges)) - { - daily = string.Join(", ", rpt.DailyPartChanges.Split(',')); - dailyPartChanges = @rpt.DailyPartChanges.Split(',').Length; - } - - - if (!string.IsNullOrEmpty(rpt.WeeklyPartChanges)) - { - weekly = string.Join(", ", rpt.WeeklyPartChanges.Split(',')); - weeklyPartChanges = @rpt.WeeklyPartChanges.Split(',').Length; - } + List dailyCompletedPartChanges = Model.CompletedDailyPartChanges.Select(x => x.REACTOR).ToList(); + List dailyProjectedPartChanges = Model.ProjectedDailyPartChanges.Select(x => x.REACTOR).ToList(); + List weeklyCompletedPartChanges = Model.CompletedWeeklyPartChanges.Select(x => x.REACTOR).ToList(); + List weeklyProjectedPartChanges = Model.ProjectedWeeklyPartChanges.Select(x => x.REACTOR).ToList(); }
  • Bottle Change (@bottleChanges): @bottle
  • -
  • Daily Part Changes (@dailyPartChanges): @daily
  • -
  • Weekly Part Changes (@weeklyPartChanges): @weekly
  • +
  • Daily Part Changes +
      +
    • Done(@dailyCompletedPartChanges.Count()): @string.Join(", ", dailyCompletedPartChanges)
    • +
    • Projected(@dailyProjectedPartChanges.Count()): @string.Join(", ", dailyProjectedPartChanges)
    • +
    +
  • +
  • Weekly Part Changes +
      +
    • Done(@weeklyCompletedPartChanges.Count()): @string.Join(", ", weeklyCompletedPartChanges)
    • +
    • Projected(@weeklyProjectedPartChanges.Count()): @string.Join(", ", weeklyProjectedPartChanges)
    • +
    +
  • Hot Work Orders (@Model.CurrentHotWORunning.Count()): @string.Join(", ", Model.CurrentHotWORunning)

@@ -123,7 +122,6 @@ @foreach (ToolEventView tool in asmTools) { string owner = ""; - string hot = ""; if (Model.ToolStatesByOwner["Maintenance"].Contains(tool.MostRecentEvent.REACT_MODE)) owner = "Maint"; diff --git a/ReportingServices.UI/Views/ProductionReport/EditDailyReport.cshtml b/ReportingServices.UI/Views/ProductionReport/EditDailyReport.cshtml index aed0660..3bb5775 100644 --- a/ReportingServices.UI/Views/ProductionReport/EditDailyReport.cshtml +++ b/ReportingServices.UI/Views/ProductionReport/EditDailyReport.cshtml @@ -176,69 +176,6 @@ -
-
-
Daily Part Changes:
-
-
-
- -
-
-
- @for (int i = 20; i < 80; i++) - { - string isMatching = ""; - string[] dailyPartChanges = !string.IsNullOrEmpty(Model.DailyPartChanges) ? Model.DailyPartChanges.Split(',') : new string[0]; - - for (int j = 0; j < dailyPartChanges.Length; j++) - { - if (dailyPartChanges[j] == "R" + i) - isMatching = "checked"; - } - - - } -
-
-
- -
-
-
-
-
Weekly Part Changes:
-
-
-
- -
-
-
- @for (int i = 20; i < 80; i++) - { - string isMatching = ""; - string[] weeklyPartChanges = !string.IsNullOrEmpty(Model.WeeklyPartChanges) ? Model.WeeklyPartChanges.Split(',') : new string[0]; - - for (int j = 0; j < weeklyPartChanges.Length; j++) - { - if (weeklyPartChanges[j] == "R" + i) - isMatching = "checked"; - } - - - } -
-
-
- -
-
- \ No newline at end of file diff --git a/ReportingServices.UI/wwwroot/Assets/DailyReportInfo.json b/ReportingServices.UI/wwwroot/Assets/DailyReportInfo.json index 7396847..2939186 100644 --- a/ReportingServices.UI/wwwroot/Assets/DailyReportInfo.json +++ b/ReportingServices.UI/wwwroot/Assets/DailyReportInfo.json @@ -1 +1 @@ -{"OperatorHeadcountDays":0,"OperatorHeadcountNights":0,"OperatorCallOutsDays":0,"OperatorCallOutsNights":0,"EngineeringHeadcountDays":0,"EngineeringHeadcountNights":0,"EngineeringCallOutsDays":0,"EngineeringCallOutsNights":0,"MaintenanceHeadcountDays":0,"MaintenanceHeadcountNights":0,"MaintenanceCallOutsDays":0,"MaintenanceCallOutsNights":0,"BottleChanges":null,"DailyPartChanges":null,"WeeklyPartChanges":"R23,R25,R27,R29,R36,R37"} \ No newline at end of file +{"OperatorHeadcountDays":0,"OperatorHeadcountNights":0,"OperatorCallOutsDays":0,"OperatorCallOutsNights":0,"EngineeringHeadcountDays":0,"EngineeringHeadcountNights":0,"EngineeringCallOutsDays":0,"EngineeringCallOutsNights":0,"MaintenanceHeadcountDays":0,"MaintenanceHeadcountNights":0,"MaintenanceCallOutsDays":0,"MaintenanceCallOutsNights":0,"BottleChanges":null} \ No newline at end of file diff --git a/ReportingServices.UI/wwwroot/Assets/SLLTools.json b/ReportingServices.UI/wwwroot/Assets/SLLTools.json index f613e87..8c3a27c 100644 --- a/ReportingServices.UI/wwwroot/Assets/SLLTools.json +++ b/ReportingServices.UI/wwwroot/Assets/SLLTools.json @@ -1 +1 @@ -[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-13T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-14T00:00:00-07:00","ASM":8,"HTR":15},{"Date":"2023-01-15T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-17T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-18T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-19T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-20T00:00:00-07:00","ASM":8,"HTR":16}] \ No newline at end of file +[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-13T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-14T00:00:00-07:00","ASM":8,"HTR":15},{"Date":"2023-01-15T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-17T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-18T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-19T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-20T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-23T00:00:00-07:00","ASM":7,"HTR":16}] \ No newline at end of file diff --git a/ReportingServices.UI/wwwroot/js/site.js b/ReportingServices.UI/wwwroot/js/site.js index bd8c6f9..f102c8d 100644 --- a/ReportingServices.UI/wwwroot/js/site.js +++ b/ReportingServices.UI/wwwroot/js/site.js @@ -207,9 +207,6 @@ function compareStrings(isDate, dir, string1, string2) { var date1 = new Date(string1); var date2 = new Date(string2); - console.log(date1); - console.log(date2); - if (dir == "asc" && date1 > date2) return true;