是否可以更改angular2日期选择器bigbanner时间格式?
我们在项目中使用angular2 datepicker()。我们需要使用24小时时间表。 但它看起来似乎不能在整个组件中工作 在下面的屏幕截图中,您可以看到我可以更改标记为1的字段的格式,但不能更改标记为2的字段的格式。或3 您可以在此处查看im使用的设置: 这是组件中的错误还是缺少设置是否可以更改angular2日期选择器bigbanner时间格式?,angular,datepicker,time-format,Angular,Datepicker,Time Format,我们在项目中使用angular2 datepicker()。我们需要使用24小时时间表。 但它看起来似乎不能在整个组件中工作 在下面的屏幕截图中,您可以看到我可以更改标记为1的字段的格式,但不能更改标记为2的字段的格式。或3 您可以在此处查看im使用的设置: 这是组件中的错误还是缺少设置 因为您可以使用angular2日期选择器的替代品 从他们的自述: 1) 使用npm安装: npm install ng-pick-datetime --save 2) 添加样式。如果您使用的是Angular
因为您可以使用angular2日期选择器的替代品 从他们的自述: 1) 使用npm安装:
npm install ng-pick-datetime --save
2) 添加样式。如果您使用的是Angular CLI,则可以将其添加到styles.css中:
@import "~ng-pick-datetime/assets/style/picker.min.css";
如果未使用Angular CLI,则可以通过index.html中的元素包含picker.min.css
3) 将OwlDateTimeModule和OwlNativeDateTimeModule添加到@NgModule,如下面的示例所示
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MyTestApp } from './my-test-app';
import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
@NgModule({
imports: [
BrowserModule,
OwlDateTimeModule,
OwlNativeDateTimeModule,
],
declarations: [ MyTestApp ],
bootstrap: [ MyTestApp ]
})
export class MyTestAppModule {}
4) 将选择器连接到输入和触发器
<input [owlDateTime]="dt1" [owlDateTimeTrigger]="dt1" placeholder="Date Time">
<owl-date-time #dt1></owl-date-time>
或
退房。为什么男生不使用?或者你们需要时间和日期在同一个组件上?我们需要时间和日期在同一个组件上。如果我们能找到一个比angular2日期采集器更好的选择,我们愿意选择另一个。
<input [owlDateTime]="dt2" placeholder="Date Time">
<span [owlDateTimeTrigger]="dt2"><i class="fa fa-calendar"></i></span>
<owl-date-time #dt2></owl-date-time>