2017-05-25 24 views

回答

0

只要使用引導與日期時間本地的輸入類型。

<input class="form-control" type="datetime-local" value="2017-05-23T15:00:00" id="dateTimeInput"> 
+0

謝謝。有沒有辦法將值設置爲當前日期時間?而不是硬編碼的日期時間。 –

+0

我知道如何設置當前的日期時間。謝謝。 –

0
Start <input type="datetime-local" value="" id="dateTimeInput" size="16" class="input-medium" ng-model='start.value'> 

End <input type="datetime-local" value="" id="dateTimeInput" size="16" class="input-medium" ng-model='end.value'> 


$scope.start = {value: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours()+1, 0)}; 
$scope.end = {value: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours()+2, 0)};