@tunghtml/strapi-plugin-composite-field 1.1.9 → 1.1.10

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.
@@ -939,10 +939,16 @@ const CompositeInput = (props) => {
939
939
  });
940
940
  }
941
941
  const stringVal = String(val);
942
+ const isoDateRegex = /^(\d{4})-(\d{2})-(\d{2})(T[\d:.]+Z?)?$/;
943
+ const dateMatch = stringVal.match(isoDateRegex);
944
+ if (dateMatch) {
945
+ const [, year, month, day] = dateMatch;
946
+ return `${month}/${day}/${year}`;
947
+ }
942
948
  const timeRegex = /^(\d{2}):(\d{2}):(\d{2})(\.\d{3})?$/;
943
- const match = stringVal.match(timeRegex);
944
- if (match) {
945
- return `${match[1]}:${match[2]}`;
949
+ const timeMatch = stringVal.match(timeRegex);
950
+ if (timeMatch) {
951
+ return `${timeMatch[1]}:${timeMatch[2]}`;
946
952
  }
947
953
  return stringVal;
948
954
  }, []);
@@ -920,10 +920,16 @@ const CompositeInput = (props) => {
920
920
  });
921
921
  }
922
922
  const stringVal = String(val);
923
+ const isoDateRegex = /^(\d{4})-(\d{2})-(\d{2})(T[\d:.]+Z?)?$/;
924
+ const dateMatch = stringVal.match(isoDateRegex);
925
+ if (dateMatch) {
926
+ const [, year, month, day] = dateMatch;
927
+ return `${month}/${day}/${year}`;
928
+ }
923
929
  const timeRegex = /^(\d{2}):(\d{2}):(\d{2})(\.\d{3})?$/;
924
- const match = stringVal.match(timeRegex);
925
- if (match) {
926
- return `${match[1]}:${match[2]}`;
930
+ const timeMatch = stringVal.match(timeRegex);
931
+ if (timeMatch) {
932
+ return `${timeMatch[1]}:${timeMatch[2]}`;
927
933
  }
928
934
  return stringVal;
929
935
  }, []);
@@ -37,7 +37,7 @@ const index = {
37
37
  defaultMessage: "Combine multiple fields into one display value"
38
38
  },
39
39
  components: {
40
- Input: async () => Promise.resolve().then(() => require("../_chunks/CompositeInput-B27rDvur.js"))
40
+ Input: async () => Promise.resolve().then(() => require("../_chunks/CompositeInput-DjJxL_5Z.js"))
41
41
  },
42
42
  options: {
43
43
  base: [
@@ -34,7 +34,7 @@ const index = {
34
34
  defaultMessage: "Combine multiple fields into one display value"
35
35
  },
36
36
  components: {
37
- Input: async () => import("../_chunks/CompositeInput-L5-14cJV.mjs")
37
+ Input: async () => import("../_chunks/CompositeInput-yW3aLiyf.mjs")
38
38
  },
39
39
  options: {
40
40
  base: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tunghtml/strapi-plugin-composite-field",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "A Strapi v5 plugin to create composite display fields by combining multiple text, string, and enum fields with auto-generate support",
5
5
  "keywords": [
6
6
  "strapi",