I found a script that is called Datepicker to have a calendar where a user can pick a date and time.
I want them to pick a date and start time and end time as well and this one looks good on a demo page.
But if I want to store the values that are entered into a string to save in my db, how would that be done?
<script>
// initialize input widgets first
$('#basicExample .time').timepicker({
'showDuration': true,
'timeFormat': 'H:i'
});
$('#basicExample .date').datepicker({
'format': 'yyyy-mm-dd',
'autoclose': true
});
// initialize datepair
var basicExampleEl = document.getElementById('basicExample');
var datepair = new Datepair(basicExampleEl);
</script>
I would like to store it in a string with the date and time. But I have no idea how to do this from the inputs I get.
They are supposed to be included in a form later.
What are you attaching the .time and .date classes to? The way I have always used datepicker is to use a form text input box, and then the value from the datepicker gets picked up by my $_POST array.