@corpsmap/corpsmap 3.2.20 → 3.2.21

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.
package/lib/dev.js CHANGED
@@ -106567,7 +106567,7 @@ var config = {
106567
106567
  };
106568
106568
 
106569
106569
  var name = "@corpsmap/corpsmap";
106570
- var version$1 = "3.2.20";
106570
+ var version$1 = "3.2.21";
106571
106571
  var description = "CorpsMap as React Components";
106572
106572
  var main = "index.js";
106573
106573
  var scripts = {
@@ -132862,6 +132862,15 @@ var formatArcgisVector = function formatArcgisVector(results) {
132862
132862
 
132863
132863
  if (result) {
132864
132864
  feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
132865
+ } // Format UNIX Date
132866
+
132867
+
132868
+ if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
132869
+ var unixTimestamp = feat.properties[key];
132870
+ var milliseconds = unixTimestamp; // * 1000 in some cases.
132871
+
132872
+ var dateObject = new Date(milliseconds);
132873
+ feat.properties[key] = dateObject.toLocaleString();
132865
132874
  }
132866
132875
  }
132867
132876
  });
package/lib/prod.js CHANGED
@@ -106481,7 +106481,7 @@ var config = {
106481
106481
  };
106482
106482
 
106483
106483
  var name = "@corpsmap/corpsmap";
106484
- var version$1 = "3.2.20";
106484
+ var version$1 = "3.2.21";
106485
106485
  var description = "CorpsMap as React Components";
106486
106486
  var main = "index.js";
106487
106487
  var scripts = {
@@ -132776,6 +132776,15 @@ var formatArcgisVector = function formatArcgisVector(results) {
132776
132776
 
132777
132777
  if (result) {
132778
132778
  feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
132779
+ } // Format UNIX Date
132780
+
132781
+
132782
+ if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
132783
+ var unixTimestamp = feat.properties[key];
132784
+ var milliseconds = unixTimestamp; // * 1000 in some cases.
132785
+
132786
+ var dateObject = new Date(milliseconds);
132787
+ feat.properties[key] = dateObject.toLocaleString();
132779
132788
  }
132780
132789
  }
132781
132790
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.2.20",
3
+ "version": "3.2.21",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,6 +25,14 @@ const formatArcgisVector = function (results) {
25
25
  key
26
26
  ] = `<a href="${value}" target="_new" > ${value} </a>`;
27
27
  }
28
+ // Format UNIX Date
29
+ if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
30
+ const unixTimestamp = feat.properties[key];
31
+ const milliseconds = unixTimestamp // * 1000 in some cases.
32
+ const dateObject = new Date(milliseconds);
33
+ feat.properties[key] = dateObject.toLocaleString();
34
+ }
35
+
28
36
  }
29
37
  });
30
38
  return results;