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

@datepicker-react/hooks

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datepicker-react/hooks - npm Package Compare versions

Comparing version 1.3.0 to 1.4.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.4.1](https://github.com/tresko/react-datepicker/compare/v1.4.0...v1.4.1) (2019-06-19)
### Bug Fixes
* **accessibility:** accessibility fix ([2779136](https://github.com/tresko/react-datepicker/commit/2779136))
# [1.3.0](https://github.com/tresko/react-datepicker/compare/v1.2.3-alpha.3...v1.3.0) (2019-06-11)

@@ -8,0 +19,0 @@

26

lib/index.cjs.js

@@ -818,3 +818,3 @@ 'use strict'

),
w = react.useCallback(
L = react.useCallback(
function(e) {

@@ -825,3 +825,3 @@ return isDateSelected(e, t, a)

),
L = react.useCallback(
w = react.useCallback(
function(e) {

@@ -867,8 +867,12 @@ return isFirstOrLastSelectedDate(e, t, a)

function E(e) {
;('ArrowRight' !== e.key &&
'ArrowLeft' !== e.key &&
'ArrowDown' !== e.key &&
'ArrowUp' !== e.key) ||
S ||
(Y(new Date()), T(getInitialMonths(D, new Date())))
if (
('ArrowRight' === e.key ||
'ArrowLeft' === e.key ||
'ArrowDown' === e.key ||
'ArrowUp' === e.key) &&
!S
) {
var t = h[0]
Y(t.date), T(getInitialMonths(D, t.date))
}
}

@@ -887,5 +891,5 @@ return (

activeMonths: h,
isDateSelected: w,
isDateSelected: L,
isDateHovered: F,
isFirstOrLastSelectedDate: L,
isFirstOrLastSelectedDate: w,
isDateBlocked: O,

@@ -949,3 +953,3 @@ numberOfMonths: D,

s({startDate: t, endDate: e, focusedInput: null}),
(!S || (S && !is_same_month(e, S))) && T(getInitialMonths(D, e))
r === END_DATE || (S && (!S || is_same_month(e, S))) || T(getInitialMonths(D, e))
},

@@ -952,0 +956,0 @@ onDateFocus: Y,

@@ -25,4 +25,4 @@ import {useMemo as e, useState as t, useCallback as n, useEffect as r} from 'react'

k = /^(\d{2}([.,]\d*)?)$/,
w = /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
p = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
p = /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
w = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
T = /([Z+-].*)$/,

@@ -102,3 +102,3 @@ F = /^(Z)$/,

if ((t = k.exec(e))) return ((n = parseFloat(t[1].replace(',', '.'))) % 24) * u
if ((t = w.exec(e)))
if ((t = p.exec(e)))
return (

@@ -109,3 +109,3 @@ (n = parseInt(t[1], 10)),

)
if ((t = p.exec(e))) {
if ((t = w.exec(e))) {
;(n = parseInt(t[1], 10)), (r = parseInt(t[2], 10))

@@ -663,11 +663,11 @@ var a = parseFloat(t[3].replace(',', '.'))

}
function we(e) {
function pe(e) {
var t = te(e)
return {year: le(t), month: ge(t), date: t}
}
function pe() {
return we(ve())
function we() {
return pe(ve())
}
function Te(e, t) {
var n = t ? we(t) : pe(),
var n = t ? pe(t) : we(),
r = n.date,

@@ -678,3 +678,3 @@ a = [n]

(a = Array.from(Array(e - 1).keys()).reduce(function(e) {
return (r = he(e[e.length - 1].date, 1)), e.concat([we(r)])
return (r = he(e[e.length - 1].date, 1)), e.concat([pe(r)])
}, a)),

@@ -687,3 +687,3 @@ a

return Array.from(Array(t).keys()).reduce(function(e) {
return (r = he(r, n)), n > 0 ? e.concat([we(r)]) : [we(r)].concat(e)
return (r = he(r, n)), n > 0 ? e.concat([pe(r)]) : [pe(r)].concat(e)
}, [])

@@ -747,4 +747,4 @@ }

}),
w = k[0],
p = k[1],
p = k[0],
w = k[1],
T = t(null),

@@ -758,5 +758,5 @@ F = T[0],

function(e) {
x(e), (!b || (b && !de(e, b))) && p(Te(v, e))
x(e), (!b || (b && !de(e, b))) && w(Te(v, e))
},
[x, p, v, b],
[x, w, v, b],
),

@@ -830,8 +830,12 @@ H = n(

function L(e) {
;('ArrowRight' !== e.key &&
'ArrowLeft' !== e.key &&
'ArrowDown' !== e.key &&
'ArrowUp' !== e.key) ||
b ||
(B(new Date()), p(Te(v, new Date())))
if (
('ArrowRight' === e.key ||
'ArrowLeft' === e.key ||
'ArrowDown' === e.key ||
'ArrowUp' === e.key) &&
!b
) {
var t = p[0]
B(t.date), w(Te(v, t.date))
}
}

@@ -849,3 +853,3 @@ return (

firstDayOfWeek: h,
activeMonths: w,
activeMonths: p,
isDateSelected: H,

@@ -907,10 +911,10 @@ isDateHovered: W,

c({startDate: a, endDate: e, focusedInput: null}),
(!b || (b && !de(e, b))) && p(Te(v, e))
u === xe || (b && (!b || de(e, b))) || w(Te(v, e))
},
onDateFocus: B,
goToPreviousMonths: function() {
p(Fe(w, v, -1)), x(null)
w(Fe(p, v, -1)), x(null)
},
goToNextMonths: function() {
p(Fe(w, v, 1)), x(null)
w(Fe(p, v, 1)), x(null)
},

@@ -974,4 +978,4 @@ }

ae as dayLabelFormat,
pe as getCurrentYearMonthAndDate,
we as getDateMonthAndYear,
we as getCurrentYearMonthAndDate,
pe as getDateMonthAndYear,
re as getDays,

@@ -978,0 +982,0 @@ Te as getInitialMonths,

{
"name": "@datepicker-react/hooks",
"version": "1.3.0",
"version": "1.4.1",
"description": "React hooks for datepicker.",

@@ -5,0 +5,0 @@ "keywords": [

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