Closed CoderLordOfSECRETS closed 10 months ago
Hi, can you please provide a more complete code example? Right now it is just two functions. How are these functions called?
Looks like it works to me: https://jsfiddle.net/sao3q5uL/
In general, please don't file issues like this. Issues for Luxon should look "here is the function I called in Luxon. Here's what I expected it to do, but here's what it did." Luxon can't control what items end up in your array; it can only take in values and return things. If those things are wrong or even just confusing, we're happy to help. But this isn't the right forum for general debugging help.
Describe the bug I am Attempting to create a group of nested arrays and every time I assign the lowest level a date time it disappears. Help would be appreciated as I am not super experienced with the library.
To Reproduce function createTimeArrays(numArrays) { let arraysContainer = []; for (let i = 0; i < numArrays; i++) { let week = []; arraysContainer.push(week); for (let n = 0; n < 7; n++) { let day = []; arraysContainer[i].push(day); for (let o = 0; o < 24 * 2; o++) { let halfhour = []; arraysContainer[i][n].push(halfhour); arraysContainer[i][n][o] = "null"; } } } console.log(arraysContainer) return arraysContainer; }
function AssignDate(timeslots) { const startDateInput = document.getElementById('StartDate'); const startDate = luxon.DateTime.fromISO(startDateInput.value); console.log(startDateInput) console.log(startDate)
}
Actual vs Expected behavior Returns one blank array, should return nested datetime luxon arrays
Desktop (please complete the following information):