Hi!
I have two arrays coming from two different sources in the following format:
Array1
[
{
"Date": "2024-03-14"
},
{
"Date": "2024-03-15"
}
]
Array 2
[
{
"Start": "2024-02-01",
"End": "2024-05-31",
"Name": "Event1"
},
{
"Start": "2024-03-05",
"End": "2024-03-15",
"Name": "Event2"
}
]
What I want to achieve is this:
[
{
"Date": "2024-03-14"
"Start": "2024-02-01",
"End": "2024-05-31",
"Name": "Event1"
},
{
"Date": "2024-03-14"
"Start": "2024-03-05",
"End": "2024-03-15",
"Name": "Event2"
},
{
"Date": "2024-03-15"
"Start": "2024-02-01",
"End": "2024-05-31",
"Name": "Event1"
},
{
"Date": "2024-03-15"
"Start": "2024-03-05",
"End": "2024-03-15",
"Name": "Event2"
}
]
I am not sure what the right terminology is, but I guess I want to duplicate the array 2 by the number of items in array 1. I want to be able to check if each Date from array 1 (there will be a 7 days period each day) is during the period (Start-End) in array 2, and if it is, add to a variable to get a nice html email.
I hope it makes sense and someone can help me! Still working on my journey to understand arrays well. Thank you


Report
All responses (
Answers (