(js) Improve dates adjustments in editors

The main issue to resolve was to handle the time reset by the datepicker
when changing dates.
This commit is contained in:
Francis Lachapelle
2015-10-30 08:38:19 -04:00
parent 2bad5c0da4
commit 0b490a00c6
4 changed files with 108 additions and 38 deletions
@@ -103,8 +103,10 @@
</div>
<div layout="row" layout-align="start center" layout-wrap="layout-wrap">
<md-datepicker ng-model="editor.component.start"
label:md-placeholder="From"> <!-- date picker--></md-datepicker>
ng-change="editor.updateStartTime()"
label:md-placeholder="From"><!-- date picker --></md-datepicker>
<sg-timepicker ng-model="editor.component.start"
ng-change="editor.adjustStartTime()"
ng-hide="editor.component.isAllDay"><!-- time picker --></sg-timepicker>
</div>
</div>
@@ -114,8 +116,10 @@
</div>
<div layout="row" layout-align="start center" layout-wrap="layout-wrap">
<md-datepicker ng-model="editor.component.end"
label:md-placeholder="To"> <!-- date picker--></md-datepicker>
ng-change="editor.updateEndTime()"
label:md-placeholder="To"><!-- date picker --></md-datepicker>
<sg-timepicker ng-model="editor.component.end"
ng-change="editor.adjustEndTime()"
ng-hide="editor.component.isAllDay"><!-- time picker --></sg-timepicker>
</div>
</div>