Mobile 离子时间选择器默认值
在我的ionic应用程序中,我有一个时间选择器,如何将默认时间设置为上午10点 此字段将显示数据库中的数据(如果有),或显示为要保存的新字段 下面是我的html代码Mobile 离子时间选择器默认值,mobile,ionic-framework,Mobile,Ionic Framework,在我的ionic应用程序中,我有一个时间选择器,如何将默认时间设置为上午10点 此字段将显示数据库中的数据(如果有),或显示为要保存的新字段 下面是我的html代码 <div class="fortimepicker" ion-datetime-picker ng-model="ship.fromtimeValue">{{ship.fromtimeValue| date: "yyyy-MM-dd hh:mm a"}}</div> {{ship.fromtimeValue
<div class="fortimepicker" ion-datetime-picker ng-model="ship.fromtimeValue">{{ship.fromtimeValue| date: "yyyy-MM-dd hh:mm a"}}</div>
{{ship.fromtimeValue}日期:“yyyy-MM-dd hh:MM-a”}
您可以在角度ng模式中设置默认时间,如
<div class="fortimepicker" ion-datetime-picker ng-model="fromtimeValue">{{fromtimeValue | date: "yyyy-MM-dd hh:mm a"}}</div>
在此之后,如果打开选择器,它将显示默认时间“10:00”
如果您想检查工作示例,我已经在codepen-ion datepicker演示中添加了您的代码:,您可以在其中检查默认时间为10:00的第一行如何将代码修改为这样?yyyy-MM-dd 10:00:00am和yyyy-MM-dd 18:00:00PM?
$scope.fromtimeValue = new Date("October 13, 2014 10:00:00");//or the default date-time you want set