首页 > 解决方案 > 如何仅在角度 5 或 6 中创建时间选择器?

问题描述

我必须从给定的时间段中选择特定的时间。从日历中选择日期后,将显示可供预约的时间段。

标签: angulartimepicker

解决方案


Bootstrap DateTime Picker中有一个。

哪个具有您需要的确切组件。

<div class="input-append date" id="datetimepicker"
    data-date="12-02-2012" data-date-format="hh">
    <input class="span2" size="16" type="text" value="12-02-2012">
    <span class="add-on"><i class="icon-th"></i></span>
</div>            

像这样调用它:$('#datetimepicker').datetimepicker('remove')

引导日期时间选择器

您可以使用PrimeNG 日历

import {CalendarModule} from 'primeng/calendar';

它有timeOnly只显示时间选择器的参数。

时间选择器

<p-calendar [(ngModel)]="date8" [timeOnly]="true"></p-calendar>

推荐阅读