@descope/web-components-ui 1.134.0 → 1.135.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15959,6 +15959,31 @@ const CALENDAR_LABEL_TODAY = 'Today';
15959
15959
 
15960
15960
  const MOBILE_DEVICE_INTERACTION_TIMEOUT_MS = 150;
15961
15961
 
15962
+ // polyfill for safari Date API (which doesn't accept "YYYY-MM-DD" string as value)
15963
+ const newDate = (date, isUtcTime) => {
15964
+ if (typeof date === 'number') {
15965
+ return new Date(date);
15966
+ }
15967
+ if (typeof date === 'string') {
15968
+ const d = new Date(date.replace(/-/g, '/'));
15969
+ if (isUtcTime) {
15970
+ return new Date(
15971
+ Date.UTC(
15972
+ d.getFullYear(),
15973
+ d.getMonth(),
15974
+ d.getDate(),
15975
+ d.getHours(),
15976
+ d.getMinutes(),
15977
+ d.getSeconds(),
15978
+ d.getMilliseconds()
15979
+ )
15980
+ );
15981
+ }
15982
+ return new Date(d);
15983
+ }
15984
+ return new Date();
15985
+ };
15986
+
15962
15987
  const patterns = {
15963
15988
  MM: '(0?[1-9]|1[0-2])',
15964
15989
  DD: '(0?[1-9]|[12][0-9]|3[01])',
@@ -16030,31 +16055,6 @@ const formatEpoch = (epoch, format) => {
16030
16055
  return format.replace(/DD|MM|YYYY/g, (match) => parts[match]);
16031
16056
  };
16032
16057
 
16033
- // polyfill for safari Date API (which doesn't accept "YYYY-MM-DD" string as value)
16034
- const newDate = (date, isUtcTime) => {
16035
- if (typeof date === 'number') {
16036
- return new Date(date);
16037
- }
16038
- if (typeof date === 'string') {
16039
- const d = new Date(date.replace(/-/g, '/'));
16040
- if (isUtcTime) {
16041
- return new Date(
16042
- Date.UTC(
16043
- d.getFullYear(),
16044
- d.getMonth(),
16045
- d.getDate(),
16046
- d.getHours(),
16047
- d.getMinutes(),
16048
- d.getSeconds(),
16049
- d.getMilliseconds()
16050
- )
16051
- );
16052
- }
16053
- return new Date(d);
16054
- }
16055
- return new Date();
16056
- };
16057
-
16058
16058
  const getCurrentTime = () => newDate().getTime();
16059
16059
  const getFullYear = (epoch) => newDate(epoch).getFullYear().toString();
16060
16060
  const getMonth = (epoch) => (newDate(epoch).getMonth() + 1).toString();