I am searching for a dynamic day of week select.
So the code would recognise today is August 1st so… would work like so.
So code ( how I would like it to perform )
<select id="selectday" name="selectday" tabindex="13">
<option value="">Please select Preferred Day</option>
<option value="">Today Wed 1st Aug</option>
<option value="">Thursday 2nd Aug</option>
<option value="">Friday 3rd Aug</option>
<option value="">Saturday 4th Aug</option>
<option value="">Sunday 5th Aug</option>
</select>
Also would like if possible to factor, if current time is => 12.00pm then Today ( becomes unavailable as an option )
Does this make sense ?
Just wondered if anyone has seen anything like this and how to do it ? Prefer jquery but I suppose php would be fine.
I see plenty of date and time pickers specifically Trents https://github.com/trentrichardson/jQuery-Timepicker-Addon
But I need something very very simple and lightweight.
Only needs to show either 7 day block or 14 day block. Would prefer if Sunday was not an option , but that isnt a major issue.
Something like this should get you started… (Tested example)
This takes the current date in the format
Y-m-dand usesstrtotime()to parse an offset of+ n days. Then, we output an option with the proper display format and a machine-readabley-m-din the value.