-
Notifications
You must be signed in to change notification settings - Fork 117
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
Default value #5
Comments
Hello, I'm not senthilraj and some months lasted since you posted the answer, but I also wanted to use custom divider and I found a solution. function(tim, mini, meri) {
if(settings.show_meridian){
return tim + " : " + mini + " : " + meri;
}else{
return tim + " : " + mini;
}
} This is default one, you can find it at top of plugin source js. However, in that contest we don't have settings variable, so if you don't need the spaces and want 24h format, like me, you can modify it in this way: function(tim, mini, meri) {
return tim + ":" + mini;
} Hope it helps you or any lurker! |
Hi, and thanks for a great plugin! I had the exact same problem and made a hack for a format_string option (syntax like strftime) It's way too hackish to be worthy of a pull request, but I think something like this could be the way to go, maybe making the show_meridian option implicit in the future? |
Thank you for your replies, guys, but these hacks do not resolve the issue. I need to set default value from backend. Using your solution, I have to generate JS code right in the HTML, or load it via AJAX. It is nightmare. I have already moved to https://eonasdan.github.io/bootstrap-datetimepicker/, which solves this problem, but unfortunately it needs bootstrap. |
I made this it works fine... function getTimepickiTime(obj) { var TimeValue = obj.val(); var trimmedTimeValue = TimeValue.replace(/ /g,''); var resultSplit = trimmedTimeValue.split(':'); return resultSplit; }; $('.timepicker_start').timepicki({ start_time: getTimepickiTime($('.timepicker_start')) }); This will take the value of the input and use it as default |
I know this thread is kind of old, but you can set the default value through HTML by specifying the following attributes on your input tag:
For hours, minutes, and meridian, respectively. |
i want to pop up an alert when i change time when value is changed in the textbox i want an alert pop up.how can i accomplish this? |
@Istiak1992 |
I have fixed it by changing code in line 407 of timepicki.js to this:
Regards |
Hi! Love this plugin.
I have a question: how to set default value (start_time) using html, not js. Now it works like this:
but it is not convenient. Why not just take default value from value attribute?
Moreover, divider is now " : ", but I want to use ":", without spaces, but there is no option to change this.
Thanks in advance.
The text was updated successfully, but these errors were encountered: