Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
πŸ› Fixed time input bugs when leading zero is omitted
Browse files Browse the repository at this point in the history
closes TryGhost/Ghost#9262
- in `{{gh-date-time-picker}}` detect short 24hr format strings such as `3:30` and add a leading zero before triggering passed in actions
  • Loading branch information
kevinansfield authored and aileen committed Nov 30, 2017
1 parent e8c852e commit 5d7e513
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/components/gh-date-time-picker.js
Expand Up @@ -99,6 +99,10 @@ export default Component.extend({
},

setTime(time) {
if (time.match(/^\d:\d\d$/)) {
time = `0${time}`;
}

if (time !== this.get('_previousTime')) {
this.get('setTime')(time);
this.set('_previousTime', time);
Expand Down

0 comments on commit 5d7e513

Please sign in to comment.