tango-app-api-audit 3.4.6 → 3.4.7

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": "tango-app-api-audit",
3
- "version": "3.4.6",
3
+ "version": "3.4.7",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4768,8 +4768,19 @@ export async function convertTimestampToDateTime( timestamp ) {
4768
4768
  timestamp = Math.floor( timestamp / 1000 ); // Convert to milliseconds if needed
4769
4769
  }
4770
4770
 
4771
- // Create a new Date object
4772
- const date = new Date( timestamp );
4771
+ // Add 5 hours and 30 minutes in milliseconds
4772
+ const timeOffset = ( 5 * 60 * 60 * 1000 ) + ( 30 * 60 * 1000 );
4773
+
4774
+ // Ensure the timestamp is valid by adding the offset correctly
4775
+ const adjustedTimestamp = timestamp + timeOffset;
4776
+
4777
+ // Create a new Date object using the adjusted timestamp
4778
+ const date = new Date( adjustedTimestamp );
4779
+
4780
+ // Ensure the date is valid (timestamp may be invalid)
4781
+ if ( isNaN( date.getTime() ) ) {
4782
+ throw new Error( 'Invalid timestamp provided' );
4783
+ }
4773
4784
 
4774
4785
  // Format the date and time components
4775
4786
  const year = date.getFullYear();
@@ -4783,3 +4794,5 @@ export async function convertTimestampToDateTime( timestamp ) {
4783
4794
  // Return formatted date and time string
4784
4795
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
4785
4796
  }
4797
+
4798
+