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

Compatibility with date-fns v2.0.x #57

Open
noahbornstein opened this issue Oct 4, 2018 · 14 comments
Open

Compatibility with date-fns v2.0.x #57

noahbornstein opened this issue Oct 4, 2018 · 14 comments

Comments

@noahbornstein
Copy link

noahbornstein commented Oct 4, 2018

I'm getting complaints that dependencies are not installed during build:

These dependencies were not found:

* date-fns/add_days in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/add_months in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/add_weeks in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/end_of_week in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/get_days_in_month in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/get_month in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/get_year in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/is_after in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/is_before in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/is_same_day in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/is_same_month in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/is_valid in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/last_day_of_month in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/set_month in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/set_year in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/start_of_week in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/sub_days in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/sub_months in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js
* date-fns/sub_weeks in ./node_modules/vue-airbnb-style-datepicker/dist/vue-airbnb-style-datepicker.es.js

To install them, you can run: npm install --save date-fns/add_days date-fns/add_months date-fns/add_weeks date-fns/end_of_week date-fns/get_days_in_month date-fns/get_month date-fns/get_year date-fns/is_after date-fns/is_before date-fns/is_same_day date-fns/is_same_month date-fns/is_valid date-fns/last_day_of_month date-fns/set_month date-fns/set_year date-fns/start_of_week date-fns/sub_days date-fns/sub_months date-fns/sub_weeks

If I go into vue-airbnb-style-datepicker.es.js and change
import subMonths from 'date-fns/sub_months'; to
import subMonths from 'date-fns'; or import subMonths from 'date-fns/subMonths';
it will work. Unfortunately, that's not a possibility for deployed environments, using docker, other build tools, etc.

Any ideas on workarounds?

@MikaelEdebro
Copy link
Owner

MikaelEdebro commented Oct 6, 2018

Ahh, seems like they have changed the names of the imports in date-fns 2.x.
In the stable version (1.29.0) they use underscore for the ES2015 modules:
https://date-fns.org/v1.29.0/docs/addDays

I have to think about how to go about this. But I might do a release with breaking changes and update to date-fns 2.0. However, it will not be done before it's released as a stable version (currently only in alpha).

My only suggestion for the moment is to use the stable version of date-fns. It's a shame they havn't added some logic to handle backwards compatibility.

@MikaelEdebro
Copy link
Owner

I created an issue:
date-fns/date-fns#917

@MikaelEdebro
Copy link
Owner

Currently still in alpha. I will wait until Beta is released.

@sungraze
Copy link

sungraze commented Jul 5, 2019

Betas are in :) https://github.com/date-fns/date-fns/releases

@DavidRouyer
Copy link

@Darkecudoua
Copy link

Has this been handled? I tried to install the date picker and the terminal cries after date-fns. I installed the latest version of date-fns to no avail.

@ThomasRalee
Copy link

@kfirba
Copy link

kfirba commented Sep 4, 2019

@MikaelEdebro Any plans to upgrade to V2.0?

@marufmax
Copy link

Waiting for V2.0

@o-Chamie-o
Copy link

After installing date-fns dependencie it will work

@lfritsche
Copy link

@o-Chamie-o did you install it in your project package.json or did you try to fix it in the airbnb-style-datepicker?

@o-Chamie-o
Copy link

In fact I had to force version like this in package.json

"date-fns": "1.29.0",

@bnd170
Copy link

bnd170 commented Nov 21, 2019

I think this package can mark as abandonned. :(

@avxkim
Copy link

avxkim commented Apr 3, 2020

Yeah, it is abandoned. Use https://vcalendar.io it has all the features.

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