I am attempting to implement a date/time picker in jade/pug that resembles the example provided on this page: . I am working with a Node/express js server. However, when I click on the glyphicon-calendar icon, the calendar fails to display. I have already installed the package below: npm i bootstrap-datetimepicker-npm
My current code attempts include:
block console_content
.sensor-page(ng-controller="ambientCtrl")
h1 Sensors
// Date-Time Widget
div(class="container")
div(class="row")
div(class="col-sm-6")
div(class="form-group")
div(class='input-group date' id='datetimepicker1')
input(type='text' class="form-control")
span(class="input-group-addon")
span.glyphicon.glyphicon-calendar
script(type="text/javascript").
$( document ).ready(function () {$('#datetimepicker1').datetimepicker()});
// Sensor Checkbox Widget
p {{selection}}
label(ng-repeat='sensorName in sensors')
input(type='checkbox', name='selectedSenors[]', value='{{sensorName}}', ng-checked='selection.indexOf(sensorName) > -1', ng-click='toggleSelection(sensorName)')
| {{sensorName}}
button(ng-click="changeSensors()") Show
canvas(id="myChart")
h1 Sensor
p Info about sensors here
script(src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css')
link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css')
script(src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js')
script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js')
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js')
Nevertheless, I encountered an error with this approach. This has led me to pose the following questions:
What is the issue within the given code, and how should it be adjusted to mirror the implementation seen at the provided link?
How can I retain the chosen date-time in JavaScript and transform it into a Unix timestamp?