Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery timepicker addon to mysql lookup range
    primarykey
    data
    text
    <p>i have to inputs that i want to format in an easy to read format, however when the user selects the date, i need the output to be in a format that mysql can handle. i dont think i can change the view format independantly from the output format. so im trying to achieve what i want by using hidden input elements and alt field in timepicker but i seem to be missing something. is there a better way of doing this or am i on the right track, i can't seem to get it to work.</p> <pre><code>$('.startDate').datetimepicker({ timeFormat : "hh:mm tt", separator: ' ', showTimezone: false, altField: ".startDateHidden", altFieldTimeOnly: false, altFormat: "yy-mm-dd", altTimeFormat: "h:m t", altSeparator: " " }); $('.endDate').datetimepicker({ timeFormat : "hh:mm tt", separator: ' ', showTimezone: false, altField: ".endDateHidden", altFieldTimeOnly: false, altFormat: "yy-mm-dd", altTimeFormat: "h:m t", altSeparator: " " }); $('.startDate, .endDate, .startDateHidden, .endDateHidden').datetimepicker('setDate', (new Date()) ); </code></pre> <p>EDIT: well later in my code i make a call to the hidden fields to use the dates in an ajax call, but the getDate is returning empty for the hidden elements, being var date3 and date4</p> <pre><code>var date1 = $('.startDate').datetimepicker('getDate'); var date2 = $('.startDate').datetimepicker('getDate'); var date3 = $('.startDateHidden').datetimepicker('getDate'); var date4 = $('.endDateHidden').datetimepicker('getDate'); console.log(date1); console.log(date2); console.log(date3); console.log(date4); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload