I was able to add a week picker using this Git repository:
https://github.com/trco/bootstrap-weekpicker#getweek
When the user selects a week, the selected week is sent to a PHP script which runs a query and returns data to a datatable:
The datatable just shows where a particular rep will be located during that selected week.
What I need to do now is add the dates for each of the headers in the datatable.
For example, in the image above, the headers would look like this for week 30:
Monday - 7/22 | Tuesday - 7/23 | Wednesday - 7/24 | Thursday - 7/25 | Friday - 7/26
And of course, when week 31 is selected, the headers should change to the corresponding dates.
In the HTML, I have added some span classes to the datatable:
<table id="example1">
<thead>
<tr>
<th>Monday - <span class="date_mon"></span></th>
<th>Tuesday - <span class="date_tue"></span></th>
<th>Wednesday - <span class="date_wed"></span></th>
<th>Thursday - <span class="date_thu"></span></th>
<th>Friday - <span class="date_fri"></span></th>
</tr>
</thead>
</table>
I was thinking I could grab the weekly dates (somehow) and insert said dates into the respective span classes.
I had suggested to my team that the database gets updated to include the weekly dates. That way I could just grab the dates from the same query that brings back the data. However, that idea was opposed, even though I know that would be the simplest way to get this to work.
With that said, is there is a way to grab the dates from the same Git repository, or any other method?
Edit
So I found this:
Get week number (in the year) from a date PHP
The answer there seems close to what I'm looking for. I just need to be able to extract the dates from the week selected.