Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-time-picker

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-time-picker - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

dist/shared/__tests__/dates.js

6

dist/TimeInput.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc