react-time-picker-input
Advanced tools
Comparing version 2.1.35 to 2.1.36
@@ -70,2 +70,3 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var amPmRef = useRef(null); | ||
var timeToUpdate = useRef(null); | ||
var hourRange = useMemo(() => hour12Format ? { | ||
@@ -86,10 +87,13 @@ start: 1, | ||
var setTimeHourString = useCallback(value => { | ||
var dateParts = getDatePartsByProps(value.replace(/ /g, ""), hour12Format); | ||
setHour(dateParts.hour); | ||
setMinutes(dateParts.minute); | ||
setAmPM(dateParts.amPm); | ||
if (value.toLowerCase().includes("am")) { | ||
setAmPM("AM"); | ||
} else if (value.toLowerCase().includes("pm")) { | ||
setAmPM("PM"); | ||
if (new Date().getTime() - (timeToUpdate === null || timeToUpdate === void 0 ? void 0 : timeToUpdate.current) >= 20) { | ||
var _dateParts = getDatePartsByProps(value.replace(/ /g, ""), hour12Format); | ||
setHour(_dateParts.hour); | ||
setMinutes(_dateParts.minute); | ||
setAmPM(_dateParts.amPm); | ||
if (value.toLowerCase().includes("am")) { | ||
setAmPM("AM"); | ||
} else if (value.toLowerCase().includes("pm")) { | ||
setAmPM("PM"); | ||
} | ||
timeToUpdate.current = new Date().getTime(); | ||
} | ||
@@ -96,0 +100,0 @@ }, [hour12Format]); |
@@ -34,3 +34,3 @@ { | ||
], | ||
"version": "2.1.35", | ||
"version": "2.1.36", | ||
"private": false, | ||
@@ -37,0 +37,0 @@ "main": "dist/index.js", |
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
59540
1089