Comments (5)
The line to determine am/pm doesn't work. I changed it to this and it works fine:
this.amOrPm = this.hours > 12 || period === 'pm' ? 'PM' : 'AM';
from clockpicker.
Even after I made the corrections above, we were still having problems if they picked 12. Did they mean noon or midnight?
And after reading this http://www.simplecodeworks.com/IQ/midnight.html, I decided to switch to the 24 hour clock.
Seriously, go read it! :-)
from clockpicker.
This is the code that works for me, replacing https://github.com/weareoutman/clockpicker/blob/gh-pages/src/clockpicker.js#L679:
if (this.options.twelvehour) {
if (this.input.attr('type') === 'time') {
var hoursInMilitary = (this.amOrPm === 'PM') ? this.hours + 12 : this.hours;
value = leadingZero(hoursInMilitary) + ':' + leadingZero(this.minutes);
value = value + ':00';
}
else {
value = value + this.amOrPm;
}
}
from clockpicker.
I have the same problem... I don't want to edit the source though... I'll just use type=text for now.
from clockpicker.
Puedes editar las siguientes lineas
https://github.com/weareoutman/clockpicker/blob/gh-pages/src/clockpicker.js#L465
` this.hours = +value[0] || 0; if (this.options.twelvehour) { this.minutes = +value[1].split(' ')[0] || 0; this.amOrPm = +value[1].split(' ')[1] || 'AM'; } else { this.minutes = +value[1] || 0; } this.spanHours.html(leadingZero(this.hours)); this.spanMinutes.html(leadingZero(this.minutes)); if (this.options.twelvehour) { this.spanAmPm.html(' ' + this.amOrPm); }
`
from clockpicker.
Related Issues (20)
- How do I set start hour, start minute, end hour, end hour? HOT 1
- Bootstrap 4 support HOT 2
- Loading Clockpicker in jQuery Modal HOT 3
- [Nooby mistake] auto-close doesn't work
- Can a ClockPicker work when it's dynamically loaded? HOT 3
- Active project and material design look HOT 2
- Use of this library with Webpack/ES6 import
- [FIXED] e.originalEvent.touches is empty in chrome HOT 1
- Need a space between HH:SS AM HOT 2
- How to use Jquery clockpicker with React? HOT 1
- Clockpicker still showing in disabled
- the feedback events have no parameters HOT 3
- How to change the size of clockpicker? HOT 4
- Plugin scrolling instead of changing time
- Is it possible to hide the leading zero in single digit times in AM/PM?
- restrict minutes to one choice
- How to get currently selected hour in afterHourSelect event?
- ReferenceError: primordials is not defined HOT 1
- Is this still maintained? HOT 1
- I couldn't localize the AM and PM to some other UTF-8 language. Any help? 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 clockpicker.