Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ming680/ngDateTimePicker
一个适用于Angular1.X的dateTimePicker
https://github.com/ming680/ngDateTimePicker
angular datetimepicker
Last synced: 3 months ago
JSON representation
一个适用于Angular1.X的dateTimePicker
- Host: GitHub
- URL: https://github.com/ming680/ngDateTimePicker
- Owner: ming680
- Created: 2017-10-22T10:42:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T07:31:30.000Z (almost 7 years ago)
- Last Synced: 2024-07-28T07:06:00.065Z (4 months ago)
- Topics: angular, datetimepicker
- Language: JavaScript
- Homepage:
- Size: 316 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ngDateTimePicker
一个适用于Angular1.X的dateTimePicker![](public/images/screen1.png)
Usage
-------------```
//引入css文件
....//在引入angular.js后引入 tpl-ngDateTimePicker.js
```
## ngDateTimePicker
```angular.module('myApp',['ngDateTimePicker'])
.controller('myCtrl',function($scope){
$scope.selected = function(){
console.log('选择 完毕 可以自行选择 移除或隐藏')
}
})//ng-model 若值转换成时间为 Invalid Date 转为此刻时间
//format 属性可选 若无datetime值为时间戳
```
## ngDateTimePicker-popup
```
angular.module('myApp',['ngDateTimePicker'])
.controller('myCtrl',function($scope, ngDateTimePicker){
$scope.show = function(ev){
ngDateTimePicker.open({
$scope : $scope,
ngModel : 'datetime', //双向数据绑定
position : ev.target, //显示在某元素的位置下
format : 'yyyy-MM-dd HH:mm:ss' //绑定元素输出的格式 若无该属性,格式为时间戳
//所支持的格式 见 angular 内置date 过滤器
})
}
})
```