@clxmedia/clxforms-client 1.0.29 → 1.0.31

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CLXFormLayoutConvert = void 0;
4
+ const luxon_1 = require("luxon");
4
5
  const formatResponseValue = (response, question) => {
5
6
  var _a, _b;
6
7
  if (!(response === null || response === void 0 ? void 0 : response.value) ||
@@ -88,6 +89,23 @@ const formatResponseValue = (response, question) => {
88
89
  return "🔹 *Not provided*";
89
90
  case "NUMBER":
90
91
  return `🔢 ${String(value)}`;
92
+ case "DATE":
93
+ if (value && typeof value === "object") {
94
+ const dateValue = value;
95
+ if (dateValue.iso_date_time) {
96
+ try {
97
+ const dateObj = luxon_1.DateTime.fromISO(dateValue.iso_date_time, {
98
+ zone: dateValue.zone || "utc",
99
+ });
100
+ const formattedDate = dateObj.toFormat("MMMM dd, yyyy 'at' h:mm a z");
101
+ return `📅 ${formattedDate}`;
102
+ }
103
+ catch (_c) {
104
+ return `📅 ${dateValue.iso_date_time}`;
105
+ }
106
+ }
107
+ }
108
+ return "🔹 *Date not provided*";
91
109
  case "SCHEDULE":
92
110
  if (value && typeof value === "object") {
93
111
  const schedule = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/clxforms-client",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "CLXperience Forms Client",
5
5
  "author": "Brandon Thompson <brandont@clxmedia.com>",
6
6
  "license": "MIT",
@@ -45,16 +45,16 @@
45
45
  "peerDependencies": {},
46
46
  "dependencies": {
47
47
  "@clxmedia/types": "1.0.188",
48
- "luxon": "3.4.4"
48
+ "luxon": "^3.7.2"
49
49
  },
50
50
  "devDependencies": {
51
- "typescript": "^5.2.2",
52
- "@types/node": "^22",
53
51
  "@types/jsonwebtoken": "9.0.6",
52
+ "@types/node": "^22",
54
53
  "jest": "29.7.0",
55
- "ts-jest": "29.1.2",
56
54
  "nock": "13.5.4",
57
- "tslint": "6.1.3"
55
+ "ts-jest": "29.1.2",
56
+ "tslint": "6.1.3",
57
+ "typescript": "^5.2.2"
58
58
  },
59
59
  "jest": {
60
60
  "moduleFileExtensions": [