I am looking to implement a date picker to allow users to select a start and date. I have been recommended to use the jquery date picker however I am struggling to see how I implement into PHP.
Do I need to wrap the code into an input box or do I use the existing input box?
Date picker is related to UI so it’s not related to PHP but to jQuery. You can existing input box and call jQuery datepicker() on it to turn it to jQ date picker.
There is no such thing as PHP input box (at least not that I know of). You just place ordinary HTML input and call jQuery UI datepicker on it, if you want chosen date to be filled in that input box.
It was actually much easier than I thought it was, however I am having problems creating two datepickers on the same page. I am trying to use datepicker and datepicker1 for the start and end date. However what configuration I try doesn’t seem to work.
Can you advise how to use two functions on the same page?
I can insert the dates into the table as a text format. However understandably I cant use it as value to calcuate with.
I have tried changing the 5 different date and times available in MyAdmin but I couldn’t get that to work.
Do I need to transfer the date value into a number and treat it as an excel calculation or does MySQL treat dates as valuables which can be calculated.
I did find this but it states it is an eglish date but JQuery provides the US date format.
Note that JS uses milliseconds for unix timestamp while PHP uses seconds, so you’d need to divide this number with 1000 either in JS or in PHP before working with this number later.
Or, you can make input box read-only (so it must be filled using the date picker) and then construct unix timestamp later in PHP. Check this: http://php.net/manual/en/function.mktime.php