Comments (7)
what is your configuration object?
it seems that you have set an wrong format of getValue.
sent from mac
On Thursday, December 5, 2013 at 9:00 PM, Daniel wrote:
Hello,
I've tried implementing this very useful plugin but I've found an error while doing so.
When executing, I get the error Cannot call method 'split' of undefined. I didn't quite understand what is the split doing there (line 194), but after removing it works.
https://github.com/longbill/jquery-date-range-picker/blob/master/daterangepicker.js#L194
Current:
var defaults = opt.getValue.call(self).split( opt.separator );Fix ?:
var defaults = opt.getValue.call(self);—
Reply to this email directly or view it on GitHub (#6).
from jquery-date-range-picker.
I do not have any custom options. Just using $(node).dateRangePicker()
from an <a>
node with children nodes inside.
from jquery-date-range-picker.
what is your browser?
what about this demo? https://rawgithub.com/longbill/jquery-date-range-picker/master/index.html
from jquery-date-range-picker.
ah, it seems that the node
you used in $(node).dateRangePicker()
is not an INPUT dom. so when I get node.value
it returns undefined
and undefined
is not a String, so it does not have split
method.
Please see my demo, when you want to use this plugin on a dom that is not an INPUT element, please set custom value of setValue
and getValue
from jquery-date-range-picker.
Thank you for your feedback, I'll try that!
from jquery-date-range-picker.
I've managed to use it by storing the date on a data
attribute
$(input).dateRangePicker
getValue: ->
# Will be undefined on startup, so let's pass an empty string
return $(@).attr('data-range') or ''
setValue: (range) ->
$(@).attr('data-range', range)
from jquery-date-range-picker.
great to hear that.
from jquery-date-range-picker.
Related Issues (20)
- Today button HOT 1
- Shortcut for "This week" "This month" HOT 2
- Can week selection be from Sat to Fri
- [BUG] form with date-range-picker submits extra hour and minute params
- Incomplete french translation
- Missing croatian language HOT 2
- Why classed are cleared after use setDateRange
- Prev button not working if Init with setValue for start and end dates
- Add Greek translation HOT 3
- Is this project maintained? HOT 4
- onChangeView event or .invalid state on .prev and .next HOT 2
- How to disable some days for picking? HOT 1
- Missing Netherland language HOT 1
- How to use date and time data in the custom top bar? HOT 1
- moment => luxon HOT 1
- Migrate from Moment.js to Luxon
- Can I choose date after a date is disabled ? HOT 1
- box is undefined HOT 1
- hoveringTooltip - date being hovered HOT 1
- pre-select / default date range on initialize HOT 1
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 jquery-date-range-picker.