嗨,我正在玩 Angular ui 时间选择器 http://angular-ui.github.io/bootstrap/
当我使用它时,我的日期晚了 1 小时,我该如何更改它以及为什么?
JS
$scope.dateStart = new Date();
$scope.dateStart.setUTCHours(7);
$scope.dateStart.setUTCMinutes(0);
HTML
<div class="form-group">
<label class="control-label">Start</label>
<timepicker data-ng-model="dateStart" hour-step="1" minute-step="15" show-meridian="false"></timepicker>
</span>
</p>
</div>
当我运行它时显示时钟 08:00 但我将其设置为 07:00 如你所见 当我将其设置为例如时。 gui {{dateStart}} 上的 10:00 显示“2015-01-20T09:00:17.382Z”而不是 T10 :/
最佳答案
您需要为输出日期添加过滤器,如下所示:
{{dateStart | date:'shortTime' }}
关于javascript - Angular ui.bootstrap.timepicker 落后 1 小时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28045137/