I'm using the tempusdominus datetimepicker for my cakephp 2.9 project but can't get it to run. I'm using cakephp FormHelper so I use in my views:
<?php echo $this->Form->input('start',array('class' => 'form-control','label' => 'Start','type' => 'text'));?>
Which generates:
<input name="data[Event][start]" class="form-control" type="text" value="2018-12-07 02:52:00" id="EventStart" required="required">
This with the type=text I generate a simple input instead of the 3/5 selects with usually generate when using a date or datetime field then I call the javascript:
$('#EventStart').datetimepicker({format: 'YYYY-MM-DD hh:mm:00'});
And this usually transforms that simple text field into a datetimepicker. However it's not working.
I have this very same method in other views of my project using some other old datepicker and works great, why not here?
It may have something to do with this view being inside a plugin?
I have the js and css for this component linked at the top of the view as follows:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/js/tempusdominus-bootstrap-4.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/css/tempusdominus-bootstrap-4.min.css" />
What is wrong??