@redneckz/wildless-cms-uni-blocks 0.14.290 → 0.14.292

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.
@@ -824,6 +824,18 @@
824
824
  });
825
825
  const randomNumber = (min = 0, max = 0) => Math.floor(Math.random() * (max - min) + min);
826
826
 
827
+ const formatDate = (date, toTimeStamp = false) => {
828
+ if (typeof date === 'string') {
829
+ return date.split('-').reverse().join('.');
830
+ }
831
+ else {
832
+ const day = String(date.getDate()).padStart(2, '0');
833
+ const month = String(date.getMonth() + 1).padStart(2, '0');
834
+ const year = String(date.getFullYear());
835
+ return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
836
+ }
837
+ };
838
+
827
839
  const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
828
840
 
829
841
  function LeadServiceAPI() {
@@ -836,7 +848,7 @@
836
848
  ...getRegion$1(region, isNaturalPerson),
837
849
  ...getEmail(email, isNaturalPerson),
838
850
  ...getPhone(phone),
839
- ...(isNaturalPerson ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
851
+ ...(isNaturalPerson ? { birthday: formatDate(birthday) } : { inn, fullName }),
840
852
  ...(typeForm === 'FEEDBACK'
841
853
  ? {}
842
854
  : {
@@ -1056,18 +1068,6 @@
1056
1068
  return [value, { setValue, setTrue, setFalse, toggle }];
1057
1069
  }
1058
1070
 
1059
- const formatDate = (date, toTimeStamp = false) => {
1060
- if (typeof date === 'string') {
1061
- return date.split('-').reverse().join('.');
1062
- }
1063
- else {
1064
- const day = String(date.getDate()).padStart(2, '0');
1065
- const month = String(date.getMonth() + 1).padStart(2, '0');
1066
- const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
1067
- return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
1068
- }
1069
- };
1070
-
1071
1071
  const renderLabel = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
1072
1072
 
1073
1073
  const Input = JSX(({ key, className = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, isTextarea = false, }) => {
@@ -6155,7 +6155,7 @@
6155
6155
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6156
6156
  });
6157
6157
 
6158
- const packageVersion = "0.14.289";
6158
+ const packageVersion = "0.14.291";
6159
6159
 
6160
6160
  exports.Blocks = Blocks;
6161
6161
  exports.ContentPage = ContentPage;