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

react-datetime-picker

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-datetime-picker - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

16

dist/DateTimeInput.js

@@ -96,6 +96,16 @@ "use strict";

var defaultMinDate = new Date('0001-01-01');
var defaultMinDate = new Date();
defaultMinDate.setFullYear(1, 0, 1);
defaultMinDate.setHours(0, 0, 0, 0);
var defaultMaxDate = new Date(8.64e15);
var allViews = ['hour', 'minute', 'second'];
function toDate(value) {
if (value instanceof Date) {
return value;
}
return new Date(value);
}
function datesAreDifferent(date1, date2) {

@@ -114,3 +124,3 @@ return date1 && !date2 || !date1 && date2 || date1 && date2 && date1.getTime() !== date2.getTime();

var rawValue = value instanceof Array && value.length === 2 ? value[index] : value;
var rawValue = Array.isArray(value) && value.length === 2 ? value[index] : value;

@@ -121,3 +131,3 @@ if (!rawValue) {

var valueDate = new Date(rawValue);
var valueDate = toDate(rawValue);

@@ -124,0 +134,0 @@ if (isNaN(valueDate.getTime())) {

3

dist/DateTimeInput/NativeInput.js

@@ -82,4 +82,3 @@ "use strict";

position: 'absolute',
top: '-9999px',
left: '-9999px'
zIndex: '-999'
},

@@ -86,0 +85,0 @@ type: "datetime-local",

@@ -13,3 +13,2 @@ "use strict";

/* eslint-disable import/prefer-default-export */
function getFormatter(options) {

@@ -16,0 +15,0 @@ return function (locale, date) {

{
"name": "react-datetime-picker",
"version": "3.0.4",
"version": "3.0.5",
"description": "A date range picker for your React app.",

@@ -16,3 +16,3 @@ "main": "dist/entry.js",

"lint": "eslint sample/ src/ test/ --ext .jsx,.js",
"prepublishOnly": "yarn clean && yarn build",
"prepack": "yarn clean && yarn build",
"test": "yarn lint && yarn jest"

@@ -54,5 +54,5 @@ },

"prop-types": "^15.6.0",
"react-calendar": "^3.0.0",
"react-calendar": "^3.3.1",
"react-clock": "^2.3.0",
"react-date-picker": "^8.0.0",
"react-date-picker": "^8.0.7",
"react-fit": "^1.0.3",

@@ -67,21 +67,16 @@ "react-time-picker": "^4.0.0"

"@babel/preset-react": "^7.9.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.1",
"babel-eslint": "^10.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "~7.2.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-jsx-a11y": "^6.3.0",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.0",
"jest": "^26.0.0",
"eslint": "^7.12.0",
"eslint-config-wojtekmaj": "^0.5.0",
"jest": "^26.6.0",
"less": "^3.8.1",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-test-renderer": "^16.7.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"rimraf": "^3.0.0"
},
"peerDependencies": {
"react": ">=16.3",
"react-dom": ">=16.3"
"react": "^16.3.0 || ^17.0.0-0",
"react-dom": "^16.3.0 || ^17.0.0-0"
},

@@ -99,2 +94,2 @@ "files": [

"funding": "https://github.com/wojtekmaj/react-datetime-picker?sponsor=1"
}
}

@@ -1,2 +0,2 @@

[![npm](https://img.shields.io/npm/v/react-datetime-picker.svg)](https://www.npmjs.com/package/react-datetime-picker) ![downloads](https://img.shields.io/npm/dt/react-datetime-picker.svg) [![build](https://travis-ci.com/wojtekmaj/react-datetime-picker.svg?branch=master)](https://travis-ci.com/wojtekmaj/react-datetime-picker) ![dependencies](https://img.shields.io/david/wojtekmaj/react-datetime-picker.svg
[![npm](https://img.shields.io/npm/v/react-datetime-picker.svg)](https://www.npmjs.com/package/react-datetime-picker) ![downloads](https://img.shields.io/npm/dt/react-datetime-picker.svg) [![CI](https://github.com/wojtekmaj/react-datetime-picker/workflows/CI/badge.svg)](https://github.com/wojtekmaj/react-datetime-picker/actions) ![dependencies](https://img.shields.io/david/wojtekmaj/react-datetime-picker.svg
) ![dev dependencies](https://img.shields.io/david/dev/wojtekmaj/react-datetime-picker.svg

@@ -31,8 +31,8 @@ ) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)

Your project needs to use React 16 or later. If you use an older version of React, please refer to the table below to find a suitable React-DateTime-Picker version.
Your project needs to use React 16.3 or later. If you use an older version of React, please refer to the table below to find a suitable React-DateTime-Picker version.
|React version|Newest available React-DateTime-Picker|
|----|----|
|>16.0|latest|
|>15.5|1.0.1|
| React version | Newest compatible React-DateTime-Picker version |
|-------|-------|
| ≥16.3 |latest |
| ≥16.0 |2.x |

@@ -73,4 +73,6 @@ [React-Calendar](https://github.com/wojtekmaj/react-calendar), on which React-DateTime-Picker relies heavily, uses modern web technologies. That's why it's so fast, lightweight and easy to style. This, however, comes at a cost of [supporting only modern browsers](https://caniuse.com/#feat=internationalization).

If you don't want to use default React-DateTime-Picker styling to build upon it, you can import React-DateTime-Picker by using `import DateTimePicker from 'react-datetime-picker/dist/entry.nostyle';` instead.
If you don't want to use default React-DateTime-Picker, React-Calendar, and React-Clock styles, you can import React-DateTime-Picker without them by using `import DateTimePicker from 'react-datetime-picker/dist/entry.nostyle';` instead.
Styles loaded by the default entry file are `react-datetime-picker/dist/DateTimePicker.css`, `react-calendar/dist/Calendar.css`, and `react-clock/dist/Clock.css`. You can copy them to your project to build your own upon them.
## User guide

@@ -77,0 +79,0 @@

@@ -33,6 +33,16 @@ import React, { PureComponent } from 'react';

const defaultMinDate = new Date('0001-01-01');
const defaultMinDate = new Date();
defaultMinDate.setFullYear(1, 0, 1);
defaultMinDate.setHours(0, 0, 0, 0);
const defaultMaxDate = new Date(8.64e15);
const allViews = ['hour', 'minute', 'second'];
function toDate(value) {
if (value instanceof Date) {
return value;
}
return new Date(value);
}
function datesAreDifferent(date1, date2) {

@@ -59,3 +69,3 @@ return (

const rawValue = value instanceof Array && value.length === 2 ? value[index] : value;
const rawValue = Array.isArray(value) && value.length === 2 ? value[index] : value;

@@ -66,3 +76,3 @@ if (!rawValue) {

const valueDate = new Date(rawValue);
const valueDate = toDate(rawValue);

@@ -88,5 +98,5 @@ if (isNaN(valueDate.getTime())) {

const getDetailValueFrom = args => getDetailValue(args, 0);
const getDetailValueFrom = (args) => getDetailValue(args, 0);
const getDetailValueTo = args => getDetailValue(args, 1);
const getDetailValueTo = (args) => getDetailValue(args, 1);

@@ -114,3 +124,3 @@ function isValidInput(element) {

const pattern = new RegExp(
Object.keys(elementFunctions).map(el => `${el}+`).join('|'), 'g',
Object.keys(elementFunctions).map((el) => `${el}+`).join('|'), 'g',
);

@@ -135,3 +145,3 @@ const matches = placeholder.match(pattern);

Object.keys(elementFunctions)
.find(elementFunction => currentMatch.match(elementFunction))
.find((elementFunction) => currentMatch.match(elementFunction))
]

@@ -176,6 +186,6 @@ );

|| datesAreDifferent(
...values.map(value => getDetailValueFrom({ value, minDate, maxDate })),
...values.map((value) => getDetailValueFrom({ value, minDate, maxDate })),
)
|| datesAreDifferent(
...values.map(value => getDetailValueTo({ value, minDate, maxDate })),
...values.map((value) => getDetailValueTo({ value, minDate, maxDate })),
)

@@ -440,3 +450,3 @@ ) {

this.setState(
prevState => ({
(prevState) => ({
hour: value ? convert12to24(parseInt(value, 10), prevState.amPm) : null,

@@ -540,6 +550,6 @@ }),

if (formElementsWithoutSelect.every(formElement => !formElement.value)) {
if (formElementsWithoutSelect.every((formElement) => !formElement.value)) {
onChange(null, false);
} else if (
formElements.every(formElement => formElement.value && formElement.validity.valid)
formElements.every((formElement) => formElement.value && formElement.validity.valid)
) {

@@ -546,0 +556,0 @@ const year = parseInt(values.year, 10);

@@ -8,4 +8,2 @@ import React from 'react';

/* eslint-disable comma-dangle */
const hasFullICU = (() => {

@@ -33,3 +31,3 @@ try {

const getKey = key => ({
const getKey = (key) => ({
keyCode: keyCodes[key],

@@ -60,3 +58,3 @@ which: keyCodes[key],

const component = mount(
<DateTimeInput {...defaultProps} />
<DateTimeInput {...defaultProps} />,
);

@@ -76,3 +74,3 @@

maxDetail="minute"
/>
/>,
);

@@ -103,3 +101,3 @@

maxDetail="hour"
/>
/>,
);

@@ -133,3 +131,3 @@

value={date}
/>
/>,
);

@@ -157,3 +155,3 @@

value={date}
/>
/>,
);

@@ -181,3 +179,3 @@

value={date}
/>
/>,
);

@@ -206,3 +204,3 @@

value={date}
/>
/>,
);

@@ -231,3 +229,3 @@

value={date}
/>
/>,
);

@@ -256,3 +254,3 @@

value={date}
/>
/>,
);

@@ -278,3 +276,3 @@

value={null}
/>
/>,
);

@@ -300,3 +298,3 @@

value={[null, null]}
/>
/>,
);

@@ -324,3 +322,3 @@

value={date}
/>
/>,
);

@@ -347,3 +345,3 @@

maxDetail="second"
/>
/>,
);

@@ -367,3 +365,3 @@

maxDetail="second"
/>
/>,
);

@@ -387,3 +385,3 @@

format="y"
/>
/>,
);

@@ -403,3 +401,3 @@

format="yyyy"
/>
/>,
);

@@ -419,3 +417,3 @@

format="M"
/>
/>,
);

@@ -435,3 +433,3 @@

format="MM"
/>
/>,
);

@@ -452,3 +450,3 @@

format="MMM"
/>
/>,
);

@@ -469,3 +467,3 @@

format="MMMM"
/>
/>,
);

@@ -486,3 +484,3 @@

format="d"
/>
/>,
);

@@ -502,3 +500,3 @@

format="dd"
/>
/>,
);

@@ -521,3 +519,3 @@

format="ddd"
/>
/>,
);

@@ -535,3 +533,3 @@

format="yyyy-MM-d"
/>
/>,
);

@@ -558,3 +556,3 @@

format="h"
/>
/>,
);

@@ -574,3 +572,3 @@

format="hh"
/>
/>,
);

@@ -593,3 +591,3 @@

format="hhh"
/>
/>,
);

@@ -607,3 +605,3 @@

format="H"
/>
/>,
);

@@ -623,3 +621,3 @@

format="HH"
/>
/>,
);

@@ -642,3 +640,3 @@

format="HHH"
/>
/>,
);

@@ -656,3 +654,3 @@

format="m"
/>
/>,
);

@@ -672,3 +670,3 @@

format="mm"
/>
/>,
);

@@ -691,3 +689,3 @@

format="mmm"
/>
/>,
);

@@ -705,3 +703,3 @@

format="s"
/>
/>,
);

@@ -721,3 +719,3 @@

format="ss"
/>
/>,
);

@@ -740,3 +738,3 @@

format="sss"
/>
/>,
);

@@ -754,3 +752,3 @@

format="a"
/>
/>,
);

@@ -768,3 +766,3 @@

const component = mount(
<DateTimeInput {...defaultProps} />
<DateTimeInput {...defaultProps} />,
);

@@ -787,3 +785,3 @@

maxDetail="hour"
/>
/>,
);

@@ -801,3 +799,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -821,3 +819,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -834,3 +832,3 @@

const separators = component.find('.react-datetime-picker__inputGroup__divider');
const separatorsTexts = separators.map(el => el.text()).filter(el => el.trim());
const separatorsTexts = separators.map((el) => el.text()).filter((el) => el.trim());
const separatorKey = separatorsTexts[0];

@@ -845,3 +843,3 @@ dayInput.simulate('keydown', getKey(separatorKey));

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -858,3 +856,3 @@

const separators = component.find('.react-datetime-picker__inputGroup__divider');
const separatorsTexts = separators.map(el => el.text()).filter(el => el.trim());
const separatorsTexts = separators.map((el) => el.text()).filter((el) => el.trim());
const separatorKey = separatorsTexts[separatorsTexts.length - 1];

@@ -869,3 +867,3 @@ dayInput.simulate('keydown', getKey(separatorKey));

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -887,3 +885,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -907,3 +905,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -926,3 +924,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -945,3 +943,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -964,3 +962,3 @@

<DateTimeInput {...defaultProps} />,
{ attachTo: container }
{ attachTo: container },
);

@@ -988,3 +986,3 @@

value={date}
/>
/>,
);

@@ -1013,3 +1011,3 @@

value={date}
/>
/>,
);

@@ -1041,3 +1039,3 @@

value={date}
/>
/>,
);

@@ -1065,3 +1063,3 @@

value={date}
/>
/>,
);

@@ -1089,3 +1087,3 @@

value={date}
/>
/>,
);

@@ -1115,3 +1113,3 @@

value={date}
/>
/>,
);

@@ -1118,0 +1116,0 @@

@@ -26,5 +26,5 @@ import React from 'react';

case 'hour':
return receivedValue => `${getISOLocalDate(receivedValue)}T${getHours(receivedValue)}:00`;
return (receivedValue) => `${getISOLocalDate(receivedValue)}T${getHours(receivedValue)}:00`;
case 'minute':
return receivedValue => `${getISOLocalDate(receivedValue)}T${getHoursMinutes(receivedValue)}`;
return (receivedValue) => `${getISOLocalDate(receivedValue)}T${getHoursMinutes(receivedValue)}`;
case 'second':

@@ -68,4 +68,3 @@ return getISOLocalDateTime;

position: 'absolute',
top: '-9999px',
left: '-9999px',
zIndex: '-999',
}}

@@ -72,0 +71,0 @@ type="datetime-local"

@@ -6,4 +6,2 @@ import React from 'react';

/* eslint-disable comma-dangle */
describe('NativeInput', () => {

@@ -17,3 +15,3 @@ const defaultProps = {

const component = shallow(
<NativeInput {...defaultProps} />
<NativeInput {...defaultProps} />,
);

@@ -33,3 +31,3 @@

ariaLabel={nativeInputAriaLabel}
/>
/>,
);

@@ -49,3 +47,3 @@

name={name}
/>
/>,
);

@@ -65,3 +63,3 @@

valueType,
parsedValue
parsedValue,
}) => {

@@ -75,3 +73,3 @@ const value = new Date(2017, 8, 30, 22, 17, 41);

valueType={valueType}
/>
/>,
);

@@ -87,3 +85,3 @@

const component = shallow(
<NativeInput {...defaultProps} />
<NativeInput {...defaultProps} />,
);

@@ -101,3 +99,3 @@

disabled
/>
/>,
);

@@ -112,3 +110,3 @@

const component = shallow(
<NativeInput {...defaultProps} />
<NativeInput {...defaultProps} />,
);

@@ -126,3 +124,3 @@

required
/>
/>,
);

@@ -137,3 +135,3 @@

const component = shallow(
<NativeInput {...defaultProps} />
<NativeInput {...defaultProps} />,
);

@@ -153,3 +151,3 @@

valueType,
parsedMin
parsedMin,
}) => {

@@ -161,3 +159,3 @@ const component = shallow(

valueType={valueType}
/>
/>,
);

@@ -177,3 +175,3 @@

valueType,
parsedMin
parsedMin,
}) => {

@@ -185,3 +183,3 @@ const component = shallow(

valueType={valueType}
/>
/>,
);

@@ -196,3 +194,3 @@

const component = shallow(
<NativeInput {...defaultProps} />
<NativeInput {...defaultProps} />,
);

@@ -212,3 +210,3 @@

valueType,
parsedMax
parsedMax,
}) => {

@@ -220,3 +218,3 @@ const component = shallow(

valueType={valueType}
/>
/>,
);

@@ -243,3 +241,3 @@

valueType={valueType}
/>
/>,
);

@@ -246,0 +244,0 @@

@@ -156,3 +156,3 @@ import React, { PureComponent } from 'react';

toggleCalendar = () => {
this.setState(prevState => ({
this.setState((prevState) => ({
isCalendarOpen: !prevState.isCalendarOpen,

@@ -176,3 +176,3 @@ isClockOpen: false,

stopPropagation = event => event.stopPropagation();
stopPropagation = (event) => event.stopPropagation();

@@ -187,3 +187,3 @@ clear = () => this.onChange(null);

const fnName = shouldListenWithFallback ? 'addEventListener' : 'removeEventListener';
outsideActionEvents.forEach(eventName => document[fnName](eventName, this.onOutsideAction));
outsideActionEvents.forEach((eventName) => document[fnName](eventName, this.onOutsideAction));
}

@@ -190,0 +190,0 @@

@@ -6,8 +6,6 @@ import React from 'react';

/* eslint-disable comma-dangle */
describe('DateTimePicker', () => {
it('passes default name to DateTimeInput', () => {
const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -24,3 +22,3 @@

const component = mount(
<DateTimePicker name={name} />
<DateTimePicker name={name} />,
);

@@ -35,3 +33,3 @@

const component = mount(
<DateTimePicker autoFocus />
<DateTimePicker autoFocus />,
);

@@ -46,3 +44,3 @@

const component = mount(
<DateTimePicker disabled />
<DateTimePicker disabled />,
);

@@ -59,3 +57,3 @@

const component = mount(
<DateTimePicker format={format} />
<DateTimePicker format={format} />,
);

@@ -79,7 +77,7 @@

secondAriaLabel: 'Second',
yearAriaLabel: 'Year'
yearAriaLabel: 'Year',
};
const component = mount(
<DateTimePicker {...ariaLabelProps} />
<DateTimePicker {...ariaLabelProps} />,
);

@@ -110,7 +108,7 @@

secondPlaceholder: 'Second',
yearPlaceholder: 'Year'
yearPlaceholder: 'Year',
};
const component = mount(
<DateTimePicker {...placeholderProps} />
<DateTimePicker {...placeholderProps} />,
);

@@ -133,3 +131,3 @@

const component = mount(
<DateTimePicker value={value} />
<DateTimePicker value={value} />,
);

@@ -147,3 +145,3 @@

const component = mount(
<DateTimePicker value={[value1, value2]} />
<DateTimePicker value={[value1, value2]} />,
);

@@ -161,3 +159,3 @@

const component = mount(
<DateTimePicker className={className} />
<DateTimePicker className={className} />,
);

@@ -177,3 +175,3 @@

isCalendarOpen
/>
/>,
);

@@ -194,3 +192,3 @@

isClockOpen
/>
/>,
);

@@ -206,3 +204,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -217,3 +215,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -228,3 +226,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -239,3 +237,3 @@

const component = mount(
<DateTimePicker isCalendarOpen />
<DateTimePicker isCalendarOpen />,
);

@@ -252,3 +250,3 @@

const component = mount(
<DateTimePicker isClockOpen />
<DateTimePicker isClockOpen />,
);

@@ -265,3 +263,3 @@

const component = mount(
<DateTimePicker disableCalendar isCalendarOpen />
<DateTimePicker disableCalendar isCalendarOpen />,
);

@@ -278,3 +276,3 @@

const component = mount(
<DateTimePicker disableClock isClockOpen />
<DateTimePicker disableClock isClockOpen />,
);

@@ -291,3 +289,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -309,3 +307,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -327,3 +325,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -346,3 +344,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -365,3 +363,3 @@

const component = mount(
<DateTimePicker />
<DateTimePicker />,
);

@@ -388,3 +386,3 @@

<DateTimePicker isCalendarOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -406,3 +404,3 @@

<DateTimePicker isCalendarOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -424,3 +422,3 @@

<DateTimePicker isCalendarOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -442,3 +440,3 @@

<DateTimePicker isClockOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -460,3 +458,3 @@

<DateTimePicker isClockOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -478,3 +476,3 @@

<DateTimePicker isClockOpen />,
{ attachTo: root }
{ attachTo: root },
);

@@ -492,3 +490,3 @@

const component = mount(
<DateTimePicker isCalendarOpen />
<DateTimePicker isCalendarOpen />,
);

@@ -510,3 +508,3 @@

const component = mount(
<DateTimePicker isClockOpen />
<DateTimePicker isClockOpen />,
);

@@ -528,3 +526,3 @@

const component = mount(
<DateTimePicker isClockOpen />
<DateTimePicker isClockOpen />,
);

@@ -547,3 +545,3 @@

const component = mount(
<DateTimePicker isCalendarOpen />
<DateTimePicker isCalendarOpen />,
);

@@ -563,3 +561,3 @@

isCalendarOpen
/>
/>,
);

@@ -576,3 +574,3 @@

const component = mount(
<DateTimePicker isCalendarOpen />
<DateTimePicker isCalendarOpen />,
);

@@ -589,3 +587,3 @@

const component = mount(
<DateTimePicker isClockOpen />
<DateTimePicker isClockOpen />,
);

@@ -605,3 +603,3 @@

isClockOpen
/>
/>,
);

@@ -618,3 +616,3 @@

const component = mount(
<DateTimePicker isClockOpen />
<DateTimePicker isClockOpen />,
);

@@ -637,3 +635,3 @@

value={new Date(2018, 6, 17)}
/>
/>,
);

@@ -661,3 +659,3 @@

value={new Date(2018, 6, 17, hours, minutes, seconds, ms)}
/>
/>,
);

@@ -676,3 +674,3 @@

const component = mount(
<DateTimePicker onChange={onChange} />
<DateTimePicker onChange={onChange} />,
);

@@ -679,0 +677,0 @@

import getUserLocale from 'get-user-locale';
/* eslint-disable import/prefer-default-export */
export function getFormatter(options) {

@@ -6,0 +4,0 @@ return (locale, date) => date.toLocaleString(locale || getUserLocale(), options);

@@ -34,7 +34,7 @@ import { getFormatter } from './dateFormatter';

if (am1 !== pm1) {
return [am1, pm1].map(el => el.trim());
return [am1, pm1].map((el) => el.trim());
}
if (am2 !== pm2) {
return [am2, pm2].map(el => el.trim());
return [am2, pm2].map((el) => el.trim());
}

@@ -41,0 +41,0 @@ }

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