jquery-date-range-picker icon indicating copy to clipboard operation
jquery-date-range-picker copied to clipboard

NPM module

Open christophior opened this issue 9 years ago • 17 comments

I was wondering if there was an NPM module for this project. Thanks

christophior avatar Nov 04 '15 20:11 christophior

+1

leonidkuznetsov18 avatar Nov 24 '15 13:11 leonidkuznetsov18

NPM

https://github.com/christophior/jquery-daterangepicker-NPM

Using it with webpack and all that's really necessary is adding it to your module loaders along with moment and jquery as a loader and you're all set!

christophior avatar Jan 22 '16 19:01 christophior

You should add momentjs and jquery as package dependencies, so they get automatically installed

apertureless avatar Mar 28 '16 15:03 apertureless

if someone can provide a PR for this?

holtkamp avatar Mar 28 '16 16:03 holtkamp

@apertureless i'm guessing that the added dependencies are to my repo which is used for the npm module. If no one makes the PR later on today then i'll add the changes in myself.

Also I have a fork of this plugin that has some changes that I might try to merge with the current version and PR back into this repo just to try and keep things in sync and not diverge.

Most of the changes are just exposing different parts of the API and adding some stuff to handle the hovering states so we could add some more customization when hovering.

Quick question to anyone using the NPM module, how exactly are you using it? Just trying to get some insight. The project that I'm using it on makes use of webpack where we just have a loader that's loading it up as follows

{ test: /jquery-\-daterangepicker/, loader:'imports?jquery,moment' },

christophior avatar Mar 28 '16 19:03 christophior

Since we have package.json in repo now.

It should not be hard to publish on npm; just few commands from terminal

Quick start: https://docs.npmjs.com/getting-started/publishing-npm-packages

Full length tut: https://medium.com/@jdaudier/how-to-create-and-publish-your-first-node-js-module-444e7585b738#.h75u1htch

ankurk91 avatar May 27 '16 03:05 ankurk91

I think @longbill should register this, as author of the library

holtkamp avatar May 27 '16 12:05 holtkamp

Yes, only he can.

ankurk91 avatar May 27 '16 13:05 ankurk91

For those who wants to install this library with npm can use this command:

npm install git://github.com/longbill/jquery-date-range-picker.git#0.5.1

where 0.5.1 is the git tag

Ref

ankurk91 avatar May 30 '16 04:05 ankurk91

Bumping, because npm install with git repos doesn't work great if added as a dependency.

It would be awesome if @longbill would publish it to npm! Especially that nowadays using module bundlers is the default.

edit: @holtkamp, I'm seeing somebody has published it on npm! https://www.npmjs.com/package/jquery-date-range-picker @youpinyao has released a couple of 1.x.x versions, but the "official" releases in this repo are not at 1. How is it related to this repo and its contributors?

tomasklingen avatar Jul 05 '17 15:07 tomasklingen

Any updates on how to use it as with Webpack? For me it's just not loading: $(...).dateRangePicker is not a function with no other error.

vedmant avatar Dec 15 '17 06:12 vedmant

The plugin was published to NPM by a 3rd-party and was no longer maintained. We have regained ownership of the NPM package name and we will have a proper version published soon. Since this issue seems to be one of the earliest ones related to NPM publishing, I will keep posting updates here and close it when we have the proper NPM package set up.

monovertex avatar Sep 19 '18 20:09 monovertex

I tried to install the latest version of the plugin with yarn add longbill/jquery-date-range-picker and the command failed with

error [email protected]: The engine "node" is incompatible with this module. Expected version "~4.9.1". Got "11.13.0"
error Found incompatible module.

In dd79b09e @monovertex bumped node version to ~4.9.1 (~4.9.1 in semantic versioning means that 4.9.x versions are allowed, where x >= 1, see https://semver.npmjs.com/). @monovertex do you have any ideas what are the restrictions on the version of NodeJS in this project? And how these restrictions can be calculated based on the plugin dependencies?

Hirurg103 avatar Oct 28 '20 20:10 Hirurg103

@Hirurg103 I think the previous specified version was not even with the correct syntax, because it specified an absolute version, and might have been ignored. When I tried to install the dependencies on my machine with node 14, it failed, so this is why I bumped it.

However, this does not really matter when consuming the module as a dependency. I'll see if I can specify the node version only for development and leave it free for production, this way you'll be able to use it without running into that issue. I'll be back shortly with an update.

monovertex avatar Oct 28 '20 21:10 monovertex

@Hirurg103, please check out if it works now. I updated the requirement to allow anything above v4.9.1 for the time being.

monovertex avatar Oct 28 '20 21:10 monovertex

@monovertex I was able to successfully install version v0.21.1 of the plugin with yarn add longbill/jquery-date-range-picker. Thank you a lot for the update!

Do you plan to publish the new version to NPM? I noticed that the version history of the NPM package is different from the release history in Github. Won't it cause problems with publishing new versions of the package that match Github release versions?

Hirurg103 avatar Nov 04 '20 19:11 Hirurg103

I plan to publish it to NPM relatively soon. It will cause issues, so I'll have to bump the version to 2.X.X. Along with this update I plan to clean up the dependencies and the build setup a bit.

monovertex avatar Nov 05 '20 06:11 monovertex