Is there a way to use source format and new format WITHOUT using the datepicker control?

QuestionsIs there a way to use source format and new format WITHOUT using the datepicker control?

I have a MySQL database with a TIME field (H:i:s). I want to be able to only display and edit the time field in hours and minutes, 17:30 for example. The issue is I do NOT want the datepicker control displayed. I just want to hand key in the value but I only want the hours and minutes displayed (and when editing or adding) in the grid but still update the database as 17:30:00.

I tried to code below but it does not work as intended.
$col["formatter"] = "datetime";
$col["formatoptions"] = array("srcformat"=>'H:i:s',"newformat"=>'H:i',"opts" => array("timeOnly" => true),"opts" => array("controlType" => 'select'));
$col["editrules"] = array("required"=>false); // and is required
$cols[] = $col;

1 Answers
Abu Ghufran answered 7 years ago

Demo code can be checked from archive or online: demos/integration/timepicker.php
Also emailed you screencast.

Your Answer

7 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



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?