I am working on a project with AngularJs. Here I have 3 html controls.
- datepicker (html5's date) =>
$scope.date - timepicker (html5's time) =>
$scope.from - timepicker (html5's time) =>
$scope.to
below is html code.
<form>
<div class="form-group row">
<label for="" class="col-sm-2 col-form-label">Set date</label>
<div class="col-sm-5">
<!-- <input type="email" class="form-control" id="inputEmail3" placeholder="Email"> -->
<datepicker date-format="yyyy-MM-dd" selector="form-control">
<div class="input-group">
<input class="form-control" placeholder="Choose a date" ng-model="date" id="date" />
<spam class="input-group-addon" style="cursor: pointer">
<i class="fa fa-lg fa-calendar"></i>
</spam>
</div>
</datepicker>
</div>
</div>
<div class="form-group row">
<label for="" class="col-sm-2 col-form-label">Set time</label>
<div class="col-sm-4">
<input type="time" class="form-control" placeholder="From" ng-model="from" id="from">
</div>
<label for="" class="col-sm-1 col-form-label">To</label>
<div class="col-sm-4">
<input type="time" class="form-control" placeholder="To" ng-model="to" id="to">
</div>
</div>
</form>
now for service call i need to pass datetime, but here I'm having date and time separately.
How can I construct datetime from and datetime to from above available data?