How to find weekends inside a date array in javascript

I have a date array, what I want is to do two things with it. 1.- Tell me how many dates within it are weekends 2.- Create a new arrangement with the dates that are weekends I tried the following code but I don’t know how to return when the weekend is true, as you… Read More How to find weekends inside a date array in javascript

Javascript: Get all dates between from and to dates

I am using the following in a ReactJS app: var getDaysArray = function(s, e) { for (var a = [], d = new Date(s); d <= e; d.setDate(d.getDate() + 1)) { a.push(new Date(d)); } return a; }; const abc = new Date(item.DateTo.toDate()).toISOString().substring(0, 10); const def = new Date(item.DateFrom.toDate()).toISOString().substring(0, 10); var daylist = getDaysArray(def, abc); The… Read More Javascript: Get all dates between from and to dates

Conversion failed when converting date and/or time from character string. SQL query

I have the following SQL query: SELECT D.name, X.displayName, x.diff, X.tacticalParameter_id into kk_aux FROM ( select displayName, tacticalParameter_id, b.value,datediff(DAY,convert(date,b.value,101),convert(date,getdate(),101)) as diff from EDA_TENANT1.EDA_T_P_A A, eda_tenant1.EDA_T_P_A_V b where b.attribute_id = A.ID and displayName like ‘Fecha %’ and value <> ”) X, EDA_TENANT1.EDA_T_P C, EDA_TENANT1.EDA_TACT_P_G D WHERE X.tacticalParameter_id = C.id AND C.tacticalParameterGroup_id = D.id and D.NAME in… Read More Conversion failed when converting date and/or time from character string. SQL query

Javascript Date Object Off by One Month

I understand that javascript counts the months starting from 0. However, I don’t know how to account for this when getting a date in the future. For example, when attempting to get the date for tomorrow, the following code returns everything correct except for the month (prints as next month): const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; const… Read More Javascript Date Object Off by One Month