Datetimepicker behaving as datepicker

QuestionsDatetimepicker behaving as datepicker
Lazaros Economou asked 5 years ago

I am trying to use datetimepicker as per your example (demos/integrations/datetimepicker.phps)

$col = array();
$col[“title”] = “Date”;
$col[“name”] = “sampled”;
$col[“width”] = “150”;
$col[“editable”] = true;
$col[“formatter”] = “datetime”;
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d H:i:s’,”newformat”=>’d/m/Y H:i:s’,”opts” => array());
$col[“show”] = array(“list”=>true, “add”=>true, “edit”=>true, “view”=>true);
$cols[] = $col;

I am also including trentrichardson’s  timepicker js/css (I believe you are using the same one)

My problem is that when I click the calendar icon, I get a datepicker not a datetimepicker.

Time sliders are missing.

I’ve tried it both with included jquery and wifth 3.3.1+migrate…same result.

Debug console is error free.

$col[“formatter”] = “datetime” behaves exactly the same as $col[“formatter”] = “date”

2 Answers
Abu answered 5 years ago

If you using some bootstrap theme, then bootstrap js could be overriding datepicker function.

One way to test is to comment out theme JS files and see when it work.

Another solution could be to inlcude date time picker library at last of included files.

Lazaros Economou answered 5 years ago

I was actually just about to answer my own question…:-)

I am indeed using bootstrap but problem was lying in a different place.

This is a very old project of mine and I am allready using jquery-ui.min.js

Since I started using phpgrid I am also referencing  your bundled jquery-ui.custom.min.js

I just missed the fact that I am referencing same stuff twice 🙂

Didn’t really pay any attention, didn’t have any issues….until now

I commented out my original jquery-ui.min.js and left only with your jquery-ui.custom.min.js

Problem solved…..:-)

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?