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

selectValue is not a function #7

Open
chubz opened this issue May 11, 2017 · 2 comments
Open

selectValue is not a function #7

chubz opened this issue May 11, 2017 · 2 comments

Comments

@chubz
Copy link

chubz commented May 11, 2017

Hi, I've got a problem. I have a defined value I would like displayed when user has already selected his timezone and saved the data.
I've tried:
var ttz = moment.tz("{{form.personal_timezone.value}}")
var tz = $('#id_personal_timezone').timezones()
tz.selectValue(ttz.format("Z"))

Uncaught TypeError: tz.selectValue is not a function

but get an error about selectValue not being a function. How would I go about fixing this?

@JudgeGreg
Copy link

JudgeGreg commented Oct 17, 2017

Did you find a solution for this? @chubz @jgallen23

@benjamincacasaca
Copy link

    var tz = '-04:00';

    $('.timezoneEdit').timezones();
    var match = $('.timezoneEdit').find('option[data-offset="'+tz+'"]');
    if (match.length){
        $('.timezoneEdit').val(match.val());
    }

THIS WORKS FOR ME

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

3 participants