Comments (8)
@Istiak1992
You can use this method
$("#timepicker1").on('click',function(){
alert("Hi")
})
from timepicki.
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.
Option is format_output and it accepts a function like that:
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!
from timepicki.
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)
https://github.com/chroz/TimePicki
i - i.e. the current default is %H : %M : %p,
i override this in my pickers with "%H:%M"
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?
from timepicki.
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.
from timepicki.
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
from timepicki.
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:
data-timepicki-tim
data-timepicki-mini
data-timepicki-meri
For hours, minutes, and meridian, respectively.
Works just fine without any code changes.
from timepicki.
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?
from timepicki.
I have fixed it by changing code in line 407 of timepicki.js to this:
var value = ele[0].value.replace(/ /g, '');
if (value.length === 0) {
d = new Date();
ti = d.getHours();
mi = d.getMinutes();
}
else {
ti = parseInt(value.substr(0, 2));
mi = parseInt(value.substr(3, 2));
}
Regards
Jaime
from timepicki.
Related Issues (20)
- Change on/off
- Active Keyboard
- Bower
- Composer
- How to increase/decrease numbers when holding down arrow?
- Make The Value Optional
- input tranform ex: 17:00 to 00:00:17
- timepicki.js - please remove duplicate line HOT 3
- Need callback HOT 2
- Problem with minutes format in zip ready package
- Restricting time in 12 hr format is not working.
- Wrong format of minutes when 24hours format is used HOT 4
- How to pop up an alert whenever i change hour or minit or meridian? HOT 1
- Unable to click off on iphone mobile devices HOT 1
- Functions for open/close or open option
- When picking minutes, value sets to "0" HOT 1
- When changing hour/minute/meridian input with keyboard then clicking on the parent input, input values revert to original value
- How to destroy the timepicki?
- How to change Time in two TimePicki Components
- AM vs PM inconsistencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timepicki.