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

Uncaught TypeError: option pickTime is not recognized! #71

Open
jfly opened this issue Dec 17, 2015 · 0 comments
Open

Uncaught TypeError: option pickTime is not recognized! #71

jfly opened this issue Dec 17, 2015 · 0 comments

Comments

@jfly
Copy link

jfly commented Dec 17, 2015

The README suggests that we add the following javascript to our project:

    $(document).on('ready page:change', function() {
        $('.datepicker').datetimepicker({
            pickTime: false
        });
    });

    $(document).on('ready page:change', function() {
        $('.datetimepicker').datetimepicker({
            pickSeconds: false
        });
    });

    $(document).on('ready page:change', function() {
        $('.timepicker').datetimepicker({
            pickDate: false,
            pickSeconds: false
        });
    });

However, bootstrap-datepicker no longer has these pick* options. I get the following error when trying to use them:

Uncaught TypeError: option pickTime is not recognized!

Instead, the hasTime and hasDate methods look at actualFormat to determine if time or date pickers are needed. To get things working for my datepicker, I found that specifying a format works to get hasTime to return false:

  $('input.date_picker').datetimepicker({
    format: "yyyy-mm-dd",
  });
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

1 participant