NiK*_*NiK 6 datepicker angularjs angular-ui-bootstrap
我试图在angular bootsrap的datepicker指令中设置init-date.我收到以下错误
错误:[$ parse:syntax]语法错误:令牌'Jun'是表达式[Sun Jun 21 2015 17:00:00 GMT-0700(PDT)]第5列的意外令牌,从2015年6月21日17开始: 00:00 GMT-0700(PDT)].
以下是我正在使用的标记
<div ng-controller="DatepickerDemoCtrl">
<h4>Popup</h4>
<div class="row">
<div class="col-md-6">
<p class="input-group">
<input type="text"
class="form-control"
init-date="dateOptions.initDate"
datepicker-popup="{{format}}"
ng-model="dt"
is-open="opened"
min-date="dateOptions.minDate"
max-date="'2016-06-22'"
datepicker-options="dateOptions"
date-disabled="disabled(date, mode)"
ng-required="true" close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我有的javascript方面
angular.module('app', ['ui.bootstrap']);
angular.module('app').controller('DatepickerDemoCtrl', function ($scope) {
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
$scope.dateOptions = {
formatYear: 'yy',
startingDay: 1,
minDate: new Date(2015, 9, 9),
initDate: new Date('2015-06-22')
};
$scope.format = ['MM-dd-yyyy'];
});
Run Code Online (Sandbox Code Playgroud)
不确定我在这里可能会缺少什么...有人可以帮忙吗?
| 归档时间: |
|
| 查看次数: |
7203 次 |
| 最近记录: |