@capillarytech/cap-ui-utils 3.0.7-alpha.4 → 3.0.7-alpha.6

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.7-alpha.4",
3
+ "version": "3.0.7-alpha.6",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils/timezone.js CHANGED
@@ -64,6 +64,7 @@ export const formatDateWithTimezone = (date, orgTZ = false) => {
64
64
  */
65
65
  export const getTimezoneTooltip = (date, orgTZ = false) => {
66
66
  const orgTimezone = utilsLocalStorageApi.loadItem("orgTZ") || "Asia/Kolkata";
67
+ const serverTimezone = utilsLocalStorageApi.loadItem("serverTZ") || "Asia/Kolkata";
67
68
 
68
69
  if(orgTZ){
69
70
  return `Timezone: ${orgTimezone} (UTC${moment.tz(orgTimezone).format("Z")})`;
@@ -79,10 +80,10 @@ export const getTimezoneTooltip = (date, orgTZ = false) => {
79
80
  if(!m.isValid()){
80
81
  m = moment.tz(date, "DD MMM YYYY h:mm A z"); // handles strings like 17 Sep 2025 6:00 AM EDT
81
82
  }
82
- if(!m.isValid()){
83
+ if(!m.isValid() || m.isUTC()){
83
84
  return `Timezone: ${orgTimezone} (UTC${moment.tz(orgTimezone).format("Z")})`; // fallback to orgTZ
84
85
  }
85
- return `Timezone: ${m.tz() || orgTimezone} (UTC${m.format("Z")})`; // return the timezone and offset
86
+ return `Timezone: ${serverTimezone} (UTC${m.format("Z")})`; // return the timezone and offset
86
87
  }
87
88
  }
88
89
  };