how to create a datetime picker in serviceportal?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2017 06:31 PM
Hi All,
Did anyone tried creating a datetime picker in ServicePortal Widgets. I tried checking the date time field available in the forms widget but the code for date time field on it is hidden and have no access to it. I tried the jquery code which is gives the exact date time field as available in the forms widget but was unable to convert it into angular code to get the value of date selected. Below is the jquery code i am using.
<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 class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script>
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
Can anyone let me know how can i use this code for datetime in service portal.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2017 06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2019 08:07 AM
Solution
Use this directive snDatePicker and add the options sn-include-time="true"
<sp-date-picker ng-model="your.model.value" sn-change="" sn-include-time="true" ></sp-date-picker>