@capillarytech/cap-ui-utils 3.0.11 → 3.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/cap-ui-utils",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {
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) => {
87
+ export const formatDateWithTimezone = (date, orgTZ = true, customTZ = null,abbr = true) => {
88
88
  try {
89
89
  if (!date) return "-";
90
90
 
@@ -93,7 +93,11 @@ export const formatDateWithTimezone = (date, orgTZ = true, customTZ = null) => {
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
- return `${momentDate.format(DATE_FORMAT)} ${tzAbbr}`;
96
+ if(abbr) {
97
+ return `${momentDate.format(DATE_FORMAT)} ${tzAbbr}`;
98
+ } else {
99
+ return `${momentDate.format(DATE_FORMAT)}`;
100
+ }
97
101
  } catch (error) {
98
102
  console.error(error);
99
103
  return "-";