Comments (3)
@jimmyn do you have a stack trace or example code that triggers the error?
from react-daterange-picker.
If you update moment-range up to 1.1.0 it will trigger the error in example.
Apparently moment-range doesn't work as a moment object when you don't pass any arguments any more. And const lang = moment().localeData()
causes error
This is the stuck trace.
DateRange (moment-range.js?a4bb:47)
(anonymous function) (CalendarMonth.js?0bc9:59)
(anonymous function) (index.js:1187)
__webpack_require__ (index.js:20)
(anonymous function) (DateRangePicker.js?6f5d:38)
(anonymous function) (index.js:1133)
__webpack_require__ (index.js:20)
(anonymous function) (index.js?4a85:11)
(anonymous function) (index.js:1127)
__webpack_require__ (index.js:20)
(anonymous function) (index.jsx?073c:9)
(anonymous function) (index.js:1091)
__webpack_require__ (index.js:20)
(anonymous function) (index.js?e382:4)
(anonymous function) (index.js:47)
__webpack_require__ (index.js:20)
(anonymous function) (index.js:40)
(anonymous function) (index.js:43)
Here is the code that causes this error
function DateRange(start, end) {
var parts;
var s = start;
var e = end;
if (arguments.length === 1 || end === undefined) {
if (start.length === 2) { // Infer array
s = start[0];
e = start[1];
}
else {
parts = start.split('/');
s = parts[0];
e = parts[1];
}
}
this.start = moment(s);
this.end = moment(e);
}
from react-daterange-picker.
Trying to work out the most suitable fix for this. Obviously we can pin the version of moment-range, but then if you're using it anywhere else, there'll be issues in terms of bundle sizes or compatibility. Maybe we can put in a little compatibility shim in the short term.
from react-daterange-picker.
Related Issues (20)
- Select Y or M after init Picker HOT 1
- Displayed range presumes selecting dates from future rather than past
- Today cell highlight HOT 1
- Please update the following components: CalendarDate, CalendarMonth, DateRangePicker, PaginationArrow HOT 1
- Custom icon for Pagination HOT 1
- How to Close calendar on date selection?
- unavailable dates shows half days on the calendar
- How to select only single day ? HOT 1
- Update moment-range to latest version 4.0.2
- SelectionType='single' and DateRange value HOT 1
- How to clear a particular selected range?
- How to localize month labels
- dependency limited to react 16.x HOT 2
- on outside click of calendar POPUP should close
- hi.. I need to show half a day selection in my project - half a day morning/evening.
- hi.. I need to show half a day selection in my project - half a day morning/evening. On passing a date, its highlighting the date partially below. How to highlight the date partially above?
- half a day selection issue
- Closing modal to reset date selection
- [Mobile view] Scrolling date picker using touch behavior also selects date
- OnSelect didn't work with onSelectStart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-daterange-picker.