react-time-picker
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -311,3 +311,3 @@ "use strict"; | ||
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true; | ||
var showLeadingZeros = currentMatch && currentMatch.length === 2; | ||
return _react.default.createElement(_Hour24Input.default, _extends({ | ||
@@ -330,3 +330,3 @@ key: "hour24" | ||
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true; | ||
var showLeadingZeros = currentMatch && currentMatch.length === 2; | ||
return _react.default.createElement(_MinuteInput.default, _extends({ | ||
@@ -508,3 +508,3 @@ key: "minute" | ||
var date = new Date(2017, 0, 1, hour24, minute, second); | ||
return this.formatTime(date).replace(this.formatNumber(hour12), 'h').replace(this.formatNumber(hour24), 'H').replace(this.formatNumber(minute), 'm').replace(this.formatNumber(second), 's').replace(new RegExp((0, _utils.getAmPmLabels)(locale).join('|')), 'a'); | ||
return this.formatTime(date).replace(this.formatNumber(hour12), 'h').replace(this.formatNumber(hour24), 'H').replace(this.formatNumber(minute), 'mm').replace(this.formatNumber(second), 'ss').replace(new RegExp((0, _utils.getAmPmLabels)(locale).join('|')), 'a'); | ||
} | ||
@@ -511,0 +511,0 @@ }, { |
{ | ||
"name": "react-time-picker", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "A time picker for your React app.", | ||
@@ -5,0 +5,0 @@ "main": "dist/entry.js", |
@@ -205,2 +205,41 @@ import React from 'react'; | ||
it('renders hour input without leading zero by default', () => { | ||
const component = mount( | ||
<TimeInput | ||
{...defaultProps} | ||
maxDetail="second" | ||
/> | ||
); | ||
const hourInput = component.find('Hour12Input'); | ||
expect(hourInput.prop('showLeadingZeros')).toBeFalsy(); | ||
}); | ||
it('renders minute input with leading zero by default', () => { | ||
const component = mount( | ||
<TimeInput | ||
{...defaultProps} | ||
maxDetail="second" | ||
/> | ||
); | ||
const minuteInput = component.find('MinuteInput'); | ||
expect(minuteInput.prop('showLeadingZeros')).toBeTruthy(); | ||
}); | ||
it('renders second input with leading zero by default', () => { | ||
const component = mount( | ||
<TimeInput | ||
{...defaultProps} | ||
maxDetail="second" | ||
/> | ||
); | ||
const secondInput = component.find('SecondInput'); | ||
expect(secondInput.prop('showLeadingZeros')).toBeTruthy(); | ||
}); | ||
describe('renders custom input in a proper order given format', () => { | ||
@@ -207,0 +246,0 @@ it('renders "h" properly', () => { |
@@ -205,4 +205,4 @@ import React, { PureComponent } from 'react'; | ||
.replace(this.formatNumber(hour24), 'H') | ||
.replace(this.formatNumber(minute), 'm') | ||
.replace(this.formatNumber(second), 's') | ||
.replace(this.formatNumber(minute), 'mm') | ||
.replace(this.formatNumber(second), 'ss') | ||
.replace(new RegExp(getAmPmLabels(locale).join('|')), 'a') | ||
@@ -399,3 +399,3 @@ ); | ||
const showLeadingZeros = currentMatch ? currentMatch.length === 2 : true; | ||
const showLeadingZeros = currentMatch && currentMatch.length === 2; | ||
@@ -419,3 +419,3 @@ return ( | ||
const showLeadingZeros = currentMatch ? currentMatch.length === 2 : true; | ||
const showLeadingZeros = currentMatch && currentMatch.length === 2; | ||
@@ -422,0 +422,0 @@ return ( |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221302
55
5367