Giter VIP home page Giter VIP logo

Comments (7)

longbill avatar longbill commented on June 15, 2024

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.

danimt avatar danimt commented on June 15, 2024

I do not have any custom options. Just using $(node).dateRangePicker() from an <a> node with children nodes inside.

from jquery-date-range-picker.

longbill avatar longbill commented on June 15, 2024

what is your browser?

what about this demo? https://rawgithub.com/longbill/jquery-date-range-picker/master/index.html

from jquery-date-range-picker.

longbill avatar longbill commented on June 15, 2024

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.

danimt avatar danimt commented on June 15, 2024

Thank you for your feedback, I'll try that!

from jquery-date-range-picker.

danimt avatar danimt commented on June 15, 2024

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.

longbill avatar longbill commented on June 15, 2024

great to hear that.

from jquery-date-range-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.