avatar dodinz
dodinz
14 Jun 2018

Steps to reproduce the issue

create component input fields that uses datetimepicker .

`
protected function getInput() {

    $id = str_replace('jform[','',str_replace(']','',$this->name));
    $html = '<div id="datetimepicker_'.$id.'" class="input-group date">'.
             '<input name="'.$this->name.'" id="'.$id.'" value="'.$this->value.'"  class="form-control" type="text" />'.
             '<span class="input-group-addon">'.
               '<span class="glyphicon glyphicon-time"></span>'.
             '</span>'.
            '</div>'.
            '<script type="text/javascript">'.
              'jQuery( function(){'.
                'jQuery("#datetimepicker_'.$id.'").datetimepicker({'.
                  'format: "LT"'.
                '});'.
              '});'.
            '</script>';
    return $html;

`

Expected result

Should be able to pick time. not date. same with https://eonasdan.github.io/bootstrap-datetimepicker/#custom-formats

Actual result

Uncaught TypeError: jQuery(...).datetimepicker is not a function at HTMLDocument.eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:59) at i (jquery.min.js:2) at Object.add [as done] (jquery.min.js:2) at n.fn.init.n.fn.ready (jquery.min.js:2) at new n.fn.init (jquery.min.js:2) at n (jquery.min.js:2) at eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:1) at eval (<anonymous>) at jquery.min.js:2 at Function.globalEval (jquery.min.js:2)

System information (as much as possible)

Joomla! 3.8.8 installed
Php 5.6.x

Additional comments

avatar dodinz dodinz - open - 14 Jun 2018
avatar brianteeman
brianteeman - comment - 14 Jun 2018

The code you refer to above requires an additional script that is not part of joomla https://eonasdan.github.io/bootstrap-datetimepicker/Installing/

avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Jun 2018
Category JavaScript
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Jun 2018
Status New Discussion
avatar ggppdk
ggppdk - comment - 14 Jun 2018

Hi

That seems to be bootstrap v3+ datetimepicker and J3.x comes with bootstrap v2

So even if you added loading of it correctly,
i don't think it will work

You can use datepicker that comes with Joomla
https://docs.joomla.org/Calendar_form_field_type

Also regarding development questions, you should post to programming forums

avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Jun 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-06-14 07:26:30
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jun 2018
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 14 Jun 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jun 2018

closed for Reason stated above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20747.

Add a Comment

Login with GitHub to post a comment