Skip to content

Multiple input formats support #496

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
AAverin opened this issue Nov 1, 2012 · 7 comments
Open

Multiple input formats support #496

AAverin opened this issue Nov 1, 2012 · 7 comments

Comments

@AAverin
Copy link

AAverin commented Nov 1, 2012

Any chance to add multiple formats support?
So user would be able to enter 10:42, 10.42, 10 42, 1042 and still get the correct time in the field?

@trentrichardson
Copy link
Owner

There are a couple new options in the dev branch which may help with this, but short answer at this point is no. In the dev branch you will find:

  • "ampm" option has been removed, use "h" for 12 hour clock, "H" for 24 hour clock.
  • "pickerTimeFormat" allows for a different time format displayed inside the timepicker than in the input (timeFormat option is for the input)
  • "strict" option was added, defaulting to true which requires the time in the input to match the exact format specified in timeFormat. Setting it to false will use javascript's Date("time string") to guess the time. This is the closest to what you want, but not as fail proof as the strict option.

@AAverin
Copy link
Author

AAverin commented Nov 1, 2012

I see...
What about adding a custom 'process' function?
for example in _addTimePicker, right before _parseTime is called? That was dev's will be able to process input before it's passed to the picker.

@trentrichardson
Copy link
Owner

Maybe I rename the option to "parse", and options could be "strict", "loose", or you can pass a function and it will be used? (Just brainstorming, its in dev so making changes is easiest now..)

This is how the controleType works, pass "slider", "select" or an object that has the needed functions to create, update, and modify the controls.

@AAverin
Copy link
Author

AAverin commented Nov 1, 2012

Good idea.

@zualexander
Copy link

hi, which settings i must set in the script when i want to change the timeformat global?
i changed the timeformat's to HH:mm for 24 hours,
when i use the timepicker it sets in 24 hours, but in the textbox there was the 12h format.

could you help me?
excuse my bad english..

@trentrichardson
Copy link
Owner

timeFormat option will format the input
pickerTimeFormat will format inside the picker itself, not the input. However it should default to timeFormat

@zualexander
Copy link

ok thanks for your help!

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