Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery? #12

Closed
roboto84 opened this issue Mar 27, 2015 · 4 comments
Closed

jQuery? #12

roboto84 opened this issue Mar 27, 2015 · 4 comments

Comments

@roboto84
Copy link

I was saddened by this when I did the NPM install and automatically made it a no go. Any way to get this kind of functionality without jQ anyone do a react only fork of this? I know this is just a port of the old jQ plugin, so I guess that may be asking for a lot, but it doesn't seem worth importing jQ for just this when I already have react, react-router, and react-bootstrap weighing me down.

Either way, thanks for your hard work, wish I could actually use this.

@skratchdot
Copy link
Owner

It would be nice to do a proper port of this library. For now, it's just a very dumb wrapper around the original library- not an actual port to react. I did it because it fit a need for a project I was working on (and I decided to publish it for other people to use if they wanted). We were already using jQuery (due to bootstrap), but now that I read the react-bootstrap docs, jQuery is only required for ie8 support.

It would be nice to remove the jQuery dependency, but that would mean actually porting/fixing all the code in the original library: https://github.com/skratchdot/react-bootstrap-daterangepicker/blob/master/lib/daterangepicker.js

Right now I periodically update that file w/ the upstream code, so it'd be a maintenance issue as well.

I'll leave this open though in case anyone feels like doing this...

@roboto84
Copy link
Author

I hear you bro, that jQ datepicker has been around for a while, and must be pretty solid by now. It would suck to reimplement this thing.... hmm this is the javascript world though lol. Thanks for the response.

@roboto84
Copy link
Author

roboto84 commented Apr 2, 2015

hmmmm anyone tried this with Zepto instead?

@roboto84 roboto84 closed this as completed Apr 2, 2015
@roboto84 roboto84 reopened this Apr 2, 2015
@skratchdot
Copy link
Owner

I haven't tested that yet. It should just require changing these 2 lines:

I'd have to think about how to make that configurable. I could leave out the hard require statements I have in index.js, and then React, jQuery, etc could be included by the end-user. That would work well in a browser environment, but my original usage of this lib was in a build environment that used browserify, so it made sense to use npm style require statements in the index.js file. Also, changing the upstream daterangepicker.js file would be more tricky since I have a script that automatically updates that file: gulp download: https://github.com/skratchdot/react-bootstrap-daterangepicker/blob/master/gulpfile.js#L17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants