How to use the interal DateTime picker for both DATETIME and DATE even with jQueryUI present.

How to use the interal DateTime picker for both DATETIME and DATE even with jQueryUI present.

AnthonyVAnthonyV Posts: 37Questions: 7Answers: 0

Link to test case:
http://live.datatables.net/leqenifa/3/edit

Debugger code (debug.datatables.net): N/A
Error messages shown: No Error message.
Description of problem:

I use jQueryUI on my page and DataTables uses jQueryUI.

The inline editor does not use the jQueryUI Date Picker for the DATETIME column but it does for the DATE column.

How can I get it to use the same internal date picker that the DATETIME column uses also for the DATE column. This is to keep things consistent within the inline editing.

Note: I can't simply remove the jQueryUI datepicker because there are other dependencies.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    Answer ✓

    Rather than using type: ‘date’, use type: ‘datetime’. It will automatically hide the time part if it isn’t specified in the format: http://live.datatables.net/leqenifa/4/edit .

    The key difference is that datetime always uses the built in date / time picker.

    date on the other hand uses the HTML5 date picker, or jQuery UI if it is available. Likely we will drop the date field type on a major upgrade at some point, replacing it with just the datetime one.

    Allan

  • AnthonyVAnthonyV Posts: 37Questions: 7Answers: 0

    That is just too easy. Thanks a lot. :)

This discussion has been closed.