有没有办法将日期选择器值添加到 Firebase 数据库中?
这些方面的东西?
$scope.AddPost = function() {
...
Published: $scope.post.Published.DATESTAMP
...
}
从物化日期选择器值如下:
<input type="date" ng-model="post.Published" class="datepicker">
选择器的服务器端代码:
<input type="text" ng-model="post.Published" class="datepicker ng-pristine ng-valid picker__input ng-touched picker__input--active picker__input--target" readonly="" id="P2078770150" tabindex="-1" aria-haspopup="true" aria-expanded="true" aria-readonly="false" aria-owns="P2078770150_root">
试过:
$scope.AddPost = function() {
myPosts.$add({
Title: $scope.post.Title,
Intro: $scope.post.Intro,
Body: $scope.post.Body,
Published: $scope.post.Published,
Author:$scope.post.Author
})
除日期外,所有内容都加载。
我一直在寻找一个等价物,但只发现Firebase.ServerValue.TIMESTAMP
这不是我想要的,因为我需要人们能够手动选择日期。