omi/plugins/omi-jquery-date-picker
kmdjs 3dd0eb60e5 update date picker plugin 2017-02-16 10:27:36 +08:00
..
example/simple omi v0.1.11 - fix event name conflict of plugin system 2017-02-16 10:26:55 +08:00
README.md update readme 2017-02-15 20:10:16 +08:00
omi-jquery-date-picker.js omi v0.1.11 - fix event name conflict of plugin system 2017-02-16 10:26:55 +08:00
package.json update date picker plugin 2017-02-16 10:27:36 +08:00
webpack.config.js omi v0.1.10 - add Omi.getParameters method for Omi plugins system 2017-02-15 20:04:38 +08:00

README.md

omi-jquery-date-picker

Omi的jquery-date-range-picker插件让你轻松在Omi项目里支持各种时间或者时间区域选择。


Demo

http://alloyteam.github.io/omi/plugins/omi-jquery-date-picker/example/simple/

通过npm安装

npm install omi-jquery-date-picker

使用

先引入一堆jquery-date-range-picker依赖的文件:

<link rel="stylesheet" href="http://longbill.github.io/jquery-date-range-picker/dist/daterangepicker.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.16.0/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="http://longbill.github.io/jquery-date-range-picker/dist/jquery.daterangepicker.min.js"></script>

然后在Omi项目里使用:

import Omi from 'omi';
import OmiJQueryDatePicker from 'omi-jquery-date-picker';

OmiJQueryDatePicker.init();

class App extends Omi.Component {
    constructor(data) {
        super(data);
    }

    applyHandle(evt, obj){
        console.log('apply', obj);
        console.log(this.datePicker);
    }

    render() {
        return  `
        <div>
            <input omi-jquery-date-picker language="cn" instanceRef="datePicker" size="40" value="" onApply="applyHandle" >
        </div>
        `;
    }
}

Omi.render(new App(),"#container");

License

This content is released under the MIT License.