@capillarytech/cap-ui-utils 3.0.12 → 3.0.13

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.
@@ -0,0 +1,3 @@
1
+
2
+ # Don't index SpecStory auto-save files, but allow explicit context inclusion via @ references
3
+ .specstory/**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/cap-ui-utils",
3
- "version": "3.0.12",
3
+ "version": "3.0.13",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "base64-js": "1.5.1",
12
12
  "buffer": "^6.0.3",
13
13
  "handlebars": "4.0.11",
14
- "lodash": "4.17.11",
14
+ "lodash": "4.17.21",
15
15
  "moment-timezone": "^0.5.25",
16
16
  "pako": "^2.1.0",
17
17
  "react": "^18.2.0",
package/utils/timezone.js CHANGED
@@ -84,7 +84,7 @@ const getTimezoneFormattedDate = (date,orgTZ = false,customTZ = null) => {
84
84
  * @param {string|null} customTZ - Custom timezone override (e.g., "Asia/Kolkata").
85
85
  * @returns {string} Formatted date string with timezone abbreviation or '-'.
86
86
  */
87
- export const formatDateWithTimezone = (date, orgTZ = true, customTZ = null,abbr = true) => {
87
+ export const formatDateWithTimezone = (date, orgTZ = true, customTZ = null) => {
88
88
  try {
89
89
  if (!date) return "-";
90
90
 
@@ -93,11 +93,7 @@ export const formatDateWithTimezone = (date, orgTZ = true, customTZ = null,abbr
93
93
  const orgTimezone = utilsLocalStorageApi.loadItem("orgTZ") || "Asia/Kolkata";
94
94
  let targetTimezone = orgTZ ? orgTimezone : customTZ ? customTZ : orgTimezone;
95
95
  let tzAbbr = getTimezoneAbbreviation(targetTimezone);
96
- if(abbr) {
97
- return `${momentDate.format(DATE_FORMAT)} ${tzAbbr}`;
98
- } else {
99
- return `${momentDate.format(DATE_FORMAT)}`;
100
- }
96
+ return `${momentDate.format(DATE_FORMAT)} ${tzAbbr}`;
101
97
  } catch (error) {
102
98
  console.error(error);
103
99
  return "-";