How to use Datatables Editor Date, Time, and Datetime pickers in side a custom field plugin popup

How to use Datatables Editor Date, Time, and Datetime pickers in side a custom field plugin popup

obrienjobrienj Posts: 93Questions: 38Answers: 0

I have a working custom field plugin in which, for consistancy reasons, I would like to use the Editor built-in date, time, and datetime pickers.

The field to receive/contain the date picked is NOT in the Editor bubble but in a pop-up my custom field plugin presents.

The definition of the tags in the plugin is completely under my control as is the content of the jQuery plugin and, of course, the code in my custom field plugin.

How could I do this?

Regards,
Jim

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Hi Jim,

    This isn't really directly possible at the moment I'm afraid. The built in date time picker is not currently exposed via a public and documented API. It is technically possibly to use, but you need to drag through to code to be able to do so. Having said that, exposing the date time picker is something I want to do in future as it can be useful!

    So three possible options:

    1. Drag through the code as above
    2. Use a standalone Editor form with inline editing and just a single field.
    3. Have a look at Pickaday - the styling of the Editor input is largely influenced by that. The downside is that it doesn't have a built in time picker.

    Allan

  • obrienjobrienj Posts: 93Questions: 38Answers: 0

    BTW, have you changed the built-in daytime picker so it doesn't close once a date is picked but before a time can be picked?

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    No - that is something that I've still to look into.

    Allan

  • obrienjobrienj Posts: 93Questions: 38Answers: 0

    Can I suggest that you make the datetime picker look like the editor bubble with an "X" in the upper right for "Cancel" and a "Save" button at the bottom.

    Making it callable at the same time would be nice. :-)

    Regards,
    Jim

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Sounds like a nice idea - thanks for the suggestion. I've added it to my list.

    Allan

This discussion has been closed.