Skip to content

Changing time format on the fly #600

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

Open
TheCelavi opened this issue Jun 26, 2013 · 1 comment
Open

Changing time format on the fly #600

TheCelavi opened this issue Jun 26, 2013 · 1 comment

Comments

@TheCelavi
Copy link

Changing time format of time picker is not possible after time picker is initialized.

@Finesse
Copy link

Finesse commented May 29, 2020

You can by recreating the picker:

$timeInputs.each((_, input) => {
  const time = $(input).datetimepicker('getDate'); // .timepicker('getDate') doesn't work
  $(input)
    .timepicker('destroy')
    .timepicker({
      timeFormat: 'your new format',
      // all the other required timepicker options
    })
    .timepicker('setDate', time);
});

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

2 participants