mercredi 1 avril 2015

Timepicker: how to change second value by change on first?


Vote count:

0




I am working on a agenda application in PHP, Bootstrap and Angular JS.

See Plunker for live preview: http://ift.tt/1yDOE3H


Now If i want to change the "start time" with an additional hour, I want the "end time" to change also +1 hour. (so that the interval is always 1 hour minimum when changing the start time.) ofcourse, when changing the "end time" it doesn't matter if the gap is bigger than 1 hour.


I want something like this:





$scope.updateTimeEnd = function() {
$scope.TimeEnd.setHours($scope.TimeStart.getHours() + 1);
};



<div class="row">
<div class="col-xs-6">
<div class="selectStartTime">
<timepicker ng-model="TimeStart" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"></timepicker>
</div>
</div>
<div class="col-xs-6">
<div class="selectEndTime">
<timepicker ng-model="TimeEnd" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"></timepicker>
</div>
</div>
</div>





The <timepicker> element is included in this js file:<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.1.js"></script>

Can anyone tell me how to accomplish this?


I don't mind if it's with angular (eg. ng-bind) or Javascript.



asked 1 min ago







Timepicker: how to change second value by change on first?

Aucun commentaire:

Enregistrer un commentaire