Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mobile 离子时间选择器默认值_Mobile_Ionic Framework - Fatal编程技术网

Mobile 离子时间选择器默认值

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

在我的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}日期:“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