Skip to content

Commit 8ab76a9

Browse files
author
Daniel Tonon
committed
Merge branch 'hotfix/v1.0.9'
2 parents ec140a4 + fd8af65 commit 8ab76a9

15 files changed

+3449
-1320
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ An accessible polyfill for `<input type='time'/>` elements.
1212

1313
Demo available here: https://dan503.github.io/time-input-polyfill/
1414

15-
**Note:** If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is `1.0.7`. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill.
15+
<details>
16+
<summary>The recommended version is <code>1.0.9</code> or higher.</summary>
17+
18+
<p>If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is <code>1.0.9</code>. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill.</p>
19+
20+
</details>
1621

1722
## Pre-built components
1823

@@ -54,7 +59,7 @@ You didn't load the actual polyfill onto the page, you loaded a much smaller aut
5459
1. The initialiser checks if the browser supports `input[type="time"]` elements.
5560
2. If it **does**, it skips the rest of the functionality.
5661
3. If it does **not**, it will:
57-
1. load `https://cdn.jsdelivr.net/npm/[email protected].7/dist/time-input-polyfill.min.js` (the actual polyfill).
62+
1. load `https://cdn.jsdelivr.net/npm/[email protected].9/dist/time-input-polyfill.min.js` (the actual polyfill).
5863
2. Collect all existing `input[type="time"]` elements on the page.
5964
3. Loop through each `input[type="time"]` element and apply the polyfill to it.
6065

@@ -97,7 +102,7 @@ if (!supportsTime) {
97102
First check for `input[type="time"]` support.
98103

99104
```html
100-
<script src="https://cdn.jsdelivr.net/npm/[email protected].7/core/helpers/supportsTime.js"></script>
105+
<script src="https://cdn.jsdelivr.net/npm/[email protected].9/core/helpers/supportsTime.js"></script>
101106
```
102107
```js
103108
if (!supportsTime) {
@@ -108,8 +113,8 @@ if (!supportsTime) {
108113
Then gather a list of all `input[type="time"]` elements on the page, and loop through them to apply the polyfill.
109114

110115
```html
111-
<script src="https://cdn.jsdelivr.net/npm/[email protected].7/core/helpers/supportsTime.js"></script>
112-
<script src="https://cdn.jsdelivr.net/npm/[email protected].7/dist/time-input-polyfill.min.js"></script>
116+
<script src="https://cdn.jsdelivr.net/npm/[email protected].9/core/helpers/supportsTime.js"></script>
117+
<script src="https://cdn.jsdelivr.net/npm/[email protected].9/dist/time-input-polyfill.min.js"></script>
113118
```
114119
```js
115120
if (!supportsTime) {

auto.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ var loadJS = require('./core/helpers/loadJS')
44
document.addEventListener('DOMContentLoaded', function() {
55
if (!supports_time) {
66
loadJS(
7-
'https://cdn.jsdelivr.net/npm/[email protected].7/dist/time-input-polyfill.min.js',
7+
'https://cdn.jsdelivr.net/npm/[email protected].9/dist/time-input-polyfill.min.js',
88
function() {
99
var $inputs = [].slice.call(
10-
document.querySelectorAll('input[type="time"]'),
10+
document.querySelectorAll('input[type="time"]')
1111
)
1212
$inputs.forEach(function($input) {
1313
new TimePolyfill($input)
1414
})
15-
},
15+
}
1616
)
1717
}
1818
})

core/accessibility/create_a11y_block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function create_accessibility_block() {
33
$block.setAttribute('aria-live', 'assertive')
44
$block.setAttribute(
55
'style',
6-
'position: absolute; opacity: 0; height: 0; width: 0; overflow: hidden; pointer-events: none;',
6+
'position: absolute; opacity: 0; height: 0; width: 0; overflow: hidden; pointer-events: none;'
77
)
88
$block.classList.add('time-input-polyfill-accessibility-block')
99
document.querySelector('body').appendChild($block)

core/converters/convert_to_12hr_time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function convert_to_12hr_time(timeString_24hr) {
99
var hrs_24 = convert_number(result[1])
1010
var min = result[2]
1111
var hrs_12 = convert_hours_to_12hr_time(hrs_24)
12-
var isPM = hrs_24 > 12
12+
var isPM = hrs_24 >= 12
1313
var mode = isPM ? 'PM' : 'AM'
1414
return [leading_zero(hrs_12), ':', min, ' ', mode].join('')
1515
}

dist/time-input-polyfill.auto.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/time-input-polyfill.auto.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)